]> git.sur5r.net Git - openldap/blob - include/ac/errno.h
a7b10eb5d8a2aa6fc8fd785e44b48d36093c6e3b
[openldap] / include / ac / errno.h
1 /* Generic errno.h */
2 /*
3  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted only
7  * as authorized by the OpenLDAP Public License.  A copy of this
8  * license is available at http://www.OpenLDAP.org/license.html or
9  * in file LICENSE in the top-level directory of the distribution.
10  */
11
12 #ifndef _AC_ERRNO_H
13 #define _AC_ERRNO_H
14
15 #if defined( HAVE_ERRNO_H )
16 # include <errno.h>
17 #elif defined( HAVE_SYS_ERRNO_H )
18 # include <sys/errno.h>
19 #endif
20
21 #ifndef HAVE_SYS_ERRLIST
22         /* no sys_errlist */
23 #       define          sys_nerr        0
24 #       define          sys_errlist     ((char **)0)
25 #elif DECL_SYS_ERRLIST 
26         /* have sys_errlist but need declaration */
27         extern int      sys_nerr;
28         extern char     *sys_errlist[];
29 #endif
30
31 #ifndef HAVE_STRERROR
32 #define strerror(err) \
33         (err) > -1 && (err) < sys_nerr ? sys_errlist[(err)] : "unknown"
34 #endif
35
36 extern char* strerror_r();
37     
38 #endif /* _AC_ERRNO_H */