4 * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
7 * Redistribution and use in source and binary forms are permitted only
8 * as authorized by the OpenLDAP Public License. A copy of this
9 * license is available at http://www.OpenLDAP.org/license.html or
10 * in file LICENSE in the top-level directory of the distribution.
16 #if defined( HAVE_ERRNO_H )
18 #elif defined( HAVE_SYS_ERRNO_H )
19 # include <sys/errno.h>
22 #ifndef HAVE_SYS_ERRLIST
25 # define sys_errlist ((char **)0)
26 #elif DECL_SYS_ERRLIST
27 /* have sys_errlist but need declaration */
28 LDAP_LIBC_V(int) sys_nerr;
29 LDAP_LIBC_V(char) *sys_errlist[];
32 #undef _AC_ERRNO_UNKNOWN
33 #define _AC_ERRNO_UNKNOWN "unknown error"
35 #ifdef HAVE_SYS_ERRLIST
36 /* this is thread safe */
37 # define STRERROR(e) ( (e) > -1 && (e) < sys_nerr \
38 ? sys_errlist[(e)] : _AC_ERRNO_UNKNOWN )
40 #elif defined( HAVE_STRERROR )
41 /* this may not be thread safe */
42 /* and, yes, some implementations of strerror may return NULL */
43 # define STRERROR(e) ( strerror(e) \
44 ? strerror(e) : _AC_ERRNO_UNKNOWN )
47 /* this is thread safe */
48 # define STRERROR(e) ( _AC_ERRNO_UNKNOWN )
51 #endif /* _AC_ERRNO_H */