compiler/clib: Don't hide access to aroscbase behind a #define.
[AROS.git] / compiler / clib / strerror.c
blob5e7b4d27acc0ef7d316ff54bf9a743bf849f7e90
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function strerror().
6 */
8 #include "__arosc_privdata.h"
10 #include <proto/dos.h>
11 #include <errno.h>
12 #include <stdio.h>
14 extern const char * _errstrings[];
16 /*****************************************************************************
18 NAME */
19 #include <string.h>
21 char * strerror (
23 /* SYNOPSIS */
24 int n)
26 /* FUNCTION
27 Returns a readable string for an error number in errno.
29 INPUTS
30 n - The contents of errno or a #define from errno.h
32 RESULT
33 A string describing the error.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 ******************************************************************************/
47 if (n > MAX_ERRNO)
49 struct aroscbase *aroscbase = __GM_GetBase();
51 Fault(n - MAX_ERRNO, NULL, aroscbase->acb_fault_buf, sizeof(aroscbase->acb_fault_buf));
53 return aroscbase->acb_fault_buf;
56 return (char *)_errstrings[n];
57 } /* strerror */