No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / openldap / dist / include / ac / unistd.h
blob5bd6c9b8770583c4e2781d1146fe2dad62395542
1 /* Generic unistd.h */
2 /* $OpenLDAP: pkg/ldap/include/ac/unistd.h,v 1.37.2.3 2008/02/11 23:26:40 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2008 The OpenLDAP Foundation.
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
10 * Public License.
12 * A copy of this license is available in file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
17 #ifndef _AC_UNISTD_H
18 #define _AC_UNISTD_H
20 #ifdef HAVE_SYS_TYPES_H
21 # include <sys/types.h>
22 #endif
24 #ifdef HAVE_UNISTD_H
25 # include <unistd.h>
26 #endif
28 #ifdef HAVE_PROCESS_H
29 # include <process.h>
30 #endif
32 /* note: callers of crypt(3) should include <ac/crypt.h> */
34 #if defined(HAVE_GETPASSPHRASE)
35 LDAP_LIBC_F(char*)(getpassphrase)();
37 #elif defined(HAVE_GETPASS)
38 #define getpassphrase(p) getpass(p)
39 LDAP_LIBC_F(char*)(getpass)();
41 #else
42 #define NEED_GETPASSPHRASE 1
43 #define getpassphrase(p) lutil_getpass(p)
44 LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
45 #endif
47 /* getopt() defines may be in separate include file */
48 #ifdef HAVE_GETOPT_H
49 # include <getopt.h>
51 #elif !defined(HAVE_GETOPT)
52 /* no getopt, assume we need getopt-compat.h */
53 # include <getopt-compat.h>
55 #else
56 /* assume we need to declare these externs */
57 LDAP_LIBC_V (char *) optarg;
58 LDAP_LIBC_V (int) optind, opterr, optopt;
59 #endif
61 /* use lutil file locking */
62 #define ldap_lockf(x) lutil_lockf(x)
63 #define ldap_unlockf(x) lutil_unlockf(x)
64 #include <lutil_lockf.h>
67 * Windows: although sleep() will be resolved by both MSVC and Mingw GCC
68 * linkers, the function is not declared in header files. This is
69 * because Windows' version of the function is called _sleep(), and it
70 * is declared in stdlib.h
73 #ifdef _WIN32
74 #define sleep _sleep
75 #endif
77 #endif /* _AC_UNISTD_H */