Back to index

openldap  2.4.31
unistd.h
Go to the documentation of this file.
00001 /* Generic unistd.h */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 1998-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #ifndef _AC_UNISTD_H
00018 #define _AC_UNISTD_H
00019 
00020 #ifdef HAVE_SYS_TYPES_H
00021 #      include <sys/types.h>
00022 #endif
00023 
00024 #ifdef HAVE_UNISTD_H
00025 #      include <unistd.h>
00026 #endif
00027 
00028 #ifdef HAVE_PROCESS_H
00029 #      include <process.h>
00030 #endif
00031 
00032 /* note: callers of crypt(3) should include <ac/crypt.h> */
00033 
00034 #if defined(HAVE_GETPASSPHRASE)
00035 LDAP_LIBC_F(char*)(getpassphrase)();
00036 
00037 #else
00038 #define getpassphrase(p) lutil_getpass(p)
00039 LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
00040 #endif
00041 
00042 /* getopt() defines may be in separate include file */
00043 #ifdef HAVE_GETOPT_H
00044 #      include <getopt.h>
00045 
00046 #elif !defined(HAVE_GETOPT)
00047        /* no getopt, assume we need getopt-compat.h */
00048 #      include <getopt-compat.h>
00049 
00050 #else
00051        /* assume we need to declare these externs */
00052        LDAP_LIBC_V (char *) optarg;
00053        LDAP_LIBC_V (int) optind, opterr, optopt;
00054 #endif
00055 
00056 /* use lutil file locking */
00057 #define ldap_lockf(x)       lutil_lockf(x)
00058 #define ldap_unlockf(x)     lutil_unlockf(x)
00059 #include <lutil_lockf.h>
00060 
00061 /*
00062  * Windows: although sleep() will be resolved by both MSVC and Mingw GCC
00063  * linkers, the function is not declared in header files. This is
00064  * because Windows' version of the function is called _sleep(), and it
00065  * is declared in stdlib.h
00066  */
00067 
00068 #ifdef _WIN32
00069 #define sleep _sleep
00070 #endif
00071 
00072 #endif /* _AC_UNISTD_H */