3
//=============================================================================
7
* standard symbolic constants and types
9
* os_unistd.h,v 1.5 2003/12/09 15:25:41 elliott_c Exp
11
* @author Don Hinton <dhinton@dresystems.com>
12
* @author This code was originally in various places including ace/OS.h.
14
//=============================================================================
16
#ifndef ACE_OS_INCLUDE_OS_UNISTD_H
17
#define ACE_OS_INCLUDE_OS_UNISTD_H
19
#include /**/ "ace/pre.h"
21
#include "ace/config-all.h"
23
#if !defined (ACE_LACKS_PRAGMA_ONCE)
25
#endif /* ACE_LACKS_PRAGMA_ONCE */
27
#include "ace/os_include/sys/os_types.h"
28
#include "ace/os_include/os_inttypes.h"
30
#if defined (__BORLANDC__)
31
# include "ace/os_include/os_fcntl.h"
32
#endif /* __BORLANDC */
34
#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
35
# include /**/ <process.h>
37
#endif /* ACE_WIN32 && !ACE_HAS_WINCE */
39
#if defined (ACE_HAS_SYSINFO)
40
# include /**/ <sys/systeminfo.h>
41
#endif /* ACE_HAS_SYS_INFO */
43
#if !defined (ACE_LACKS_UNISTD_H)
44
# include /**/ <unistd.h>
45
#endif /* !ACE_LACKS_UNISTD_H */
48
// for unlink(), close(), read(), write(), lseek(), chdir(), getcwd(), getwd(),
50
# include /**/ <ioLib.h>
52
# include /**/ <hostLib.h>
55
// Place all additions (especially function declarations) within extern "C" {}
59
#endif /* __cplusplus */
61
#if (!defined (_BSD_SOURCE) && \
62
!defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)) \
63
|| (defined (_XOPEN_SOURCE) && defined (__GNUC__))
65
# if defined (ACE_LACKS_SETREUID_PROTOTYPE)
66
extern int setreuid (uid_t ruid, uid_t euid);
67
# endif /* ACE_LACKS_SETREUID_PROTOTYPE */
69
# if defined (ACE_LACKS_SETREGID_PROTOTYPE)
70
extern int setregid (gid_t rgid, gid_t egid);
71
# endif /* ACE_LACKS_SETREGID_PROTOTYPE */
72
#endif /* !_BSD_SOURCE && !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED
73
|| _XOPEN_SOURCE && __GNUC__ */
75
# if !defined (_SC_TIMER_MAX)
76
# define _SC_TIMER_MAX 44
77
# endif /* _SC_TIMER_MAX */
79
// Default number of <ACE_Event_Handler>s supported by
81
# if !defined (ACE_DEFAULT_TIMERS)
82
# define ACE_DEFAULT_TIMERS _SC_TIMER_MAX
83
# endif /* ACE_DEFAULT_TIMERS */
85
// for use by access()
87
# define R_OK 04 /* Test for Read permission. */
91
# define W_OK 02 /* Test for Write permission. */
95
# define X_OK 01 /* Test for eXecute permission. */
99
# define F_OK 0 /* Test for existence of File. */
103
int getgid __((void));
104
int getuid __((void));
105
char* getcwd __((char* buf, size_t size));
106
int pipe __((int* fildes));
107
int gethostname __((char*, size_t));
110
#if defined (ACE_LACKS_UALARM_PROTOTYPE)
111
u_int ualarm (u_int usecs, u_int interval);
112
#endif /* ACE_LACKS_UALARM_PROTOTYPE */
114
#if defined (ACE_LACKS_PREAD_PROTOTYPE) && (_XOPEN_SOURCE - 0) < 500
115
// _XOPEN_SOURCE == 500 Single Unix conformance
116
// It seems that _XOPEN_SOURCE == 500 means that the prototypes are
117
// already defined in the system headers.
118
ssize_t pread (int fd,
123
ssize_t pwrite (int fd,
127
#endif /* ACE_LACKS_PREAD_PROTOTYPE && (_XOPEN_SOURCE - 0) < 500 */
129
#if defined (ACE_LACKS_GETPGID_PROTOTYPE) && \
130
!defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)
131
pid_t getpgid (pid_t pid);
132
#endif /* ACE_LACKS_GETPGID_PROTOTYPE &&
133
!_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED */
135
#if !defined (_LARGEFILE64_SOURCE)
136
# if defined (ACE_LACKS_LSEEK64_PROTOTYPE) && \
137
defined (ACE_LACKS_LLSEEK_PROTOTYPE)
138
# error Define either ACE_LACKS_LSEEK64_PROTOTYPE or ACE_LACKS_LLSEEK_PROTOTYPE, not both!
139
# elif defined (ACE_LACKS_LSEEK64_PROTOTYPE)
140
ACE_LOFF_T lseek64 (int fd, ACE_LOFF_T offset, int whence);
141
# elif defined (ACE_LACKS_LLSEEK_PROTOTYPE)
142
ACE_LOFF_T llseek (int fd, ACE_LOFF_T offset, int whence);
144
#endif /* _LARGEFILE64_SOURCE */
146
#if !defined (_SC_AIO_MAX)
147
# define _SC_AIO_MAX 1
148
#endif /* _SC_AIO_MAX */
150
#if defined (__BORLANDC__)
151
# define _chdir chdir
153
# define _access access
154
# if (__BORLANDC__ <= 0x540)
155
# define _getcwd getcwd
157
# define _isatty isatty
158
#endif /* __BORLANDC__ */
160
#if defined (ACE_PSOS_SNARFS_HEADER_INFO)
161
// Header information snarfed from compiler provided header files
162
// that are not included because there is already an identically
163
// named file provided with pSOS, which does not have this info
164
// from compiler supplied header
165
int getopt(int, char *const *, const char *);
167
#endif /* ACE_PSOS_SNARFS_HEADER_INFO */
169
# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES)
171
ssize_t read_timedwait (ACE_HANDLE handle,
174
struct timespec *timeout);
176
ssize_t write_timedwait (ACE_HANDLE handle,
179
struct timespec *timeout);
181
# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */
185
#endif /* __cplusplus */
187
#include /**/ "ace/post.h"
188
#endif /* ACE_OS_INCLUDE_OS_UNISTD_H */