00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ACE_OS_INCLUDE_OS_UNISTD_H
00017 #define ACE_OS_INCLUDE_OS_UNISTD_H
00018
00019 #include "ace/pre.h"
00020
00021 #include "ace/config-lite.h"
00022
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif
00026
00027 #include "ace/os_include/sys/os_types.h"
00028 #include "ace/os_include/os_inttypes.h"
00029
00030 #if defined (__BORLANDC__)
00031 # include "ace/os_include/os_fcntl.h"
00032 #endif
00033
00034 #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
00035 # include <process.h>
00036 # include <io.h>
00037 #endif
00038
00039 #if defined (ACE_HAS_SYSINFO)
00040 # include <sys/systeminfo.h>
00041 #endif
00042
00043 #if !defined (ACE_LACKS_UNISTD_H)
00044 # include <unistd.h>
00045 #endif
00046
00047 #if defined (ACE_VXWORKS)
00048 # if !defined (__RTP__)
00049
00050
00051 # include <ioLib.h>
00052 # endif
00053
00054 # include <hostLib.h>
00055 #endif
00056
00057
00058 #ifdef __cplusplus
00059 extern "C"
00060 {
00061 #endif
00062
00063 #if (!defined (_BSD_SOURCE) && \
00064 !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)) \
00065 || (defined (_XOPEN_SOURCE) && defined (__GNUC__))
00066
00067 # if defined (ACE_LACKS_SETREUID_PROTOTYPE)
00068 extern int setreuid (uid_t ruid, uid_t euid);
00069 # endif
00070
00071 # if defined (ACE_LACKS_SETREGID_PROTOTYPE)
00072 extern int setregid (gid_t rgid, gid_t egid);
00073 # endif
00074 #endif
00075
00076
00077
00078 # if !defined (R_OK)
00079 # define R_OK 04
00080 # endif
00081
00082 # if !defined (W_OK)
00083 # define W_OK 02
00084 # endif
00085
00086 # if !defined (X_OK)
00087 # define X_OK 01
00088 # endif
00089
00090 # if !defined (F_OK)
00091 # define F_OK 0
00092 # endif
00093
00094 #if defined (ACE_LACKS_UALARM_PROTOTYPE)
00095 u_int ualarm (u_int usecs, u_int interval);
00096 #endif
00097
00098 #if defined (ACE_LACKS_PREAD_PROTOTYPE) && (_XOPEN_SOURCE - 0) < 500
00099
00100
00101
00102 ssize_t pread (int fd,
00103 void *buf,
00104 size_t nbytes,
00105 off_t offset);
00106
00107 ssize_t pwrite (int fd,
00108 const void *buf,
00109 size_t n,
00110 off_t offset);
00111 #endif
00112
00113 #if defined (ACE_LACKS_GETPGID_PROTOTYPE) && \
00114 !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)
00115 pid_t getpgid (pid_t pid);
00116 #endif
00117
00118
00119 #if !defined (_LARGEFILE64_SOURCE)
00120 # if defined (ACE_LACKS_LSEEK64_PROTOTYPE) && \
00121 defined (ACE_LACKS_LLSEEK_PROTOTYPE)
00122 # error Define either ACE_LACKS_LSEEK64_PROTOTYPE or ACE_LACKS_LLSEEK_PROTOTYPE, not both!
00123 # elif defined (ACE_LACKS_LSEEK64_PROTOTYPE)
00124 ACE_LOFF_T lseek64 (int fd, ACE_LOFF_T offset, int whence);
00125 # elif defined (ACE_LACKS_LLSEEK_PROTOTYPE)
00126 ACE_LOFF_T llseek (int fd, ACE_LOFF_T offset, int whence);
00127 # endif
00128 #endif
00129
00130 #if defined (__BORLANDC__)
00131 # if (__BORLANDC__ <= 0x540)
00132 # define _getcwd getcwd
00133 # define _chdir chdir
00134 # undef _access
00135 # define _access access
00136 # endif
00137 # define _isatty isatty
00138 #endif
00139
00140 # if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES)
00141
00142 ssize_t read_timedwait (ACE_HANDLE handle,
00143 char *buf,
00144 size_t n,
00145 struct timespec *timeout);
00146
00147 ssize_t write_timedwait (ACE_HANDLE handle,
00148 const void *buf,
00149 size_t n,
00150 struct timespec *timeout);
00151
00152 # endif
00153
00154 #if defined (ACE_LACKS_SWAB_PROTOTYPE)
00155 void swab(const void *, void *, ssize_t);
00156 #endif
00157
00158 #if defined (ACE_LACKS_GETOPT_PROTOTYPE)
00159 int getopt(int, char * const [], const char *);
00160 #endif
00161
00162 #ifdef __cplusplus
00163 }
00164 #endif
00165
00166 #include "ace/post.h"
00167 #endif