/* Generic unistd.h */1/* $OpenLDAP$ */2/* This work is part of OpenLDAP Software <http://www.openldap.org/>.3*4* Copyright 1998-2024 The OpenLDAP Foundation.5* All rights reserved.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted only as authorized by the OpenLDAP9* Public License.10*11* A copy of this license is available in file LICENSE in the12* top-level directory of the distribution or, alternatively, at13* <http://www.OpenLDAP.org/license.html>.14*/1516#ifndef _AC_UNISTD_H17#define _AC_UNISTD_H1819#ifdef HAVE_SYS_TYPES_H20# include <sys/types.h>21#endif2223#ifdef HAVE_UNISTD_H24# include <unistd.h>25#endif2627#ifdef HAVE_PROCESS_H28# include <process.h>29#endif3031/* note: callers of crypt(3) should include <ac/crypt.h> */3233#if defined(HAVE_GETPASSPHRASE)34LDAP_LIBC_F(char*)(getpassphrase)();3536#else37#define getpassphrase(p) lutil_getpass(p)38LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));39#endif4041/* getopt() defines may be in separate include file */42#ifdef HAVE_GETOPT_H43# include <getopt.h>4445#elif !defined(HAVE_GETOPT)46/* no getopt, assume we need getopt-compat.h */47# include <getopt-compat.h>4849#else50/* assume we need to declare these externs */51LDAP_LIBC_V (char *) optarg;52LDAP_LIBC_V (int) optind, opterr, optopt;53#endif5455/* use lutil file locking */56#define ldap_lockf(x) lutil_lockf(x)57#define ldap_unlockf(x) lutil_unlockf(x)58#include <lutil_lockf.h>5960/*61* Windows: although sleep() will be resolved by both MSVC and Mingw GCC62* linkers, the function is not declared in header files. This is63* because Windows' version of the function is called _sleep(), and it64* is declared in stdlib.h65*/6667#ifdef _WIN3268#define sleep _sleep69#endif7071#endif /* _AC_UNISTD_H */727374