]> git.sur5r.net Git - openldap/blob - include/ac/unistd.h
Merge latest devel codes into releng 2 branch.
[openldap] / include / ac / unistd.h
1 /* Generic unistd.h */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
5  * All rights reserved.
6  *
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.
11  */
12
13 #ifndef _AC_UNISTD_H
14 #define _AC_UNISTD_H
15
16 #if HAVE_SYS_TYPES_H
17 #       include <sys/types.h>
18 #endif
19
20 #if HAVE_UNISTD_H
21 #       include <unistd.h>
22 #endif
23
24 #if HAVE_PROCESS_H
25 #       include <process.h>
26 #endif
27
28 /* note: callers of crypt(3) should include <ac/crypt.h> */
29
30 #if defined(HAVE_GETPASSPHRASE)
31 LIBC_F(char*)(getpassphrase)();
32
33 #elif defined(HAVE_GETPASS)
34 #define getpassphrase(p) getpass(p)
35 LIBC_F(char*)(getpass)();
36
37 #else
38 #define NEED_GETPASSPHRASE 1
39 #define getpassphrase(p) lutil_getpass(p)
40 LIBLUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
41 #endif
42
43 /* getopt() defines may be in separate include file */
44 #if HAVE_GETOPT_H
45 #       include <getopt.h>
46
47 #elif !defined(HAVE_GETOPT)
48         /* no getopt, assume we need getopt-compat.h */
49 #       include <getopt-compat.h>
50
51 #else
52         /* assume we need to declare these externs */
53         LIBC_F (char *) optarg;
54         LIBC_F (int) optind, opterr, optopt;
55 #endif
56
57 #ifndef HAVE_TEMPNAM
58         LIBLUTIL_F(char *)(tempnam) LDAP_P(( const char *tmpdir,
59                                              const char *prefix));
60 #endif
61
62 /* use lutil file locking */
63 #define ldap_lockf(x)   lutil_lockf(x)
64 #define ldap_unlockf(x) lutil_unlockf(x)
65 #include <lutil_lockf.h>
66
67 #endif /* _AC_UNISTD_H */