]> git.sur5r.net Git - openldap/blob - include/ac/unistd.h
Import headers with updated notices
[openldap] / include / ac / unistd.h
1 /* Generic unistd.h */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2001 The OpenLDAP Foundation, Redwood City, California, USA
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted only as authorized by the OpenLDAP
9  * Public License.  A copy of this license is available at
10  * http://www.OpenLDAP.org/license.html or in file LICENSE in the
11  * top-level directory of the distribution.
12  */
13
14 #ifndef _AC_UNISTD_H
15 #define _AC_UNISTD_H
16
17 #if HAVE_SYS_TYPES_H
18 #       include <sys/types.h>
19 #endif
20
21 #if HAVE_UNISTD_H
22 #       include <unistd.h>
23 #endif
24
25 #if HAVE_PROCESS_H
26 #       include <process.h>
27 #endif
28
29 /* note: callers of crypt(3) should include <ac/crypt.h> */
30
31 #if defined(HAVE_GETPASSPHRASE)
32 LDAP_LIBC_F(char*)(getpassphrase)();
33
34 #elif defined(HAVE_GETPASS)
35 #define getpassphrase(p) getpass(p)
36 LDAP_LIBC_F(char*)(getpass)();
37
38 #else
39 #define NEED_GETPASSPHRASE 1
40 #define getpassphrase(p) lutil_getpass(p)
41 LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
42 #endif
43
44 /* getopt() defines may be in separate include file */
45 #if HAVE_GETOPT_H
46 #       include <getopt.h>
47
48 #elif !defined(HAVE_GETOPT)
49         /* no getopt, assume we need getopt-compat.h */
50 #       include <getopt-compat.h>
51
52 #else
53         /* assume we need to declare these externs */
54         LDAP_LIBC_V (char *) optarg;
55         LDAP_LIBC_V (int) optind, opterr, optopt;
56 #endif
57
58 #ifndef HAVE_TEMPNAM
59         LDAP_LUTIL_F(char *)(tempnam) LDAP_P((
60                 const char *tmpdir,
61                 const char *prefix));
62 #endif
63
64 /* use lutil file locking */
65 #define ldap_lockf(x)   lutil_lockf(x)
66 #define ldap_unlockf(x) lutil_unlockf(x)
67 #include <lutil_lockf.h>
68
69 #endif /* _AC_UNISTD_H */