Need double escape
[ACE_TAO.git] / ACE / ace / os_include / os_unistd.h
blob14d1621d3ba9ba2b10854e9c0009c9f92af24181
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file os_unistd.h
7 * standard symbolic constants and types
9 * @author Don Hinton <dhinton@dresystems.com>
10 * @author This code was originally in various places including ace/OS.h.
12 //=============================================================================
14 #ifndef ACE_OS_INCLUDE_OS_UNISTD_H
15 #define ACE_OS_INCLUDE_OS_UNISTD_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/config-lite.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "ace/os_include/sys/os_types.h"
26 #include "ace/os_include/os_inttypes.h"
28 #if defined (ACE_HAS_PROCESS_H)
29 # include /**/ <process.h>
30 #endif /* ACE_HAS_PROCESS_H */
32 #if defined (ACE_HAS_IO_H)
33 # include /**/ <io.h>
34 #endif /* ACE_HAS_IO_H */
36 #if !defined (ACE_LACKS_UNISTD_H)
37 # include /**/ <unistd.h>
38 #endif /* !ACE_LACKS_UNISTD_H */
40 #if defined (ACE_VXWORKS)
41 # if !defined (__RTP__)
42 // for unlink(), close(), read(), write(), lseek(), chdir(), getcwd(),
43 // getwd(), and isatty()
44 # include /**/ <ioLib.h>
45 # endif
46 // for gethostname()
47 # include /**/ <hostLib.h>
48 #endif /* ACE_VXWORKS */
50 #ifdef ACE_MQX
51 # if !defined (STDIN_FILENO) && defined (_LLIO_STDIN)
52 # define STDIN_FILENO (_LLIO_STDIN)
53 # endif
54 # if !defined (STDOUT_FILENO) && defined (_LLIO_STDOUT)
55 # define STDOUT_FILENO (_LLIO_STDOUT)
56 # endif
57 # if !defined (STDERR_FILENO) && defined (_LLIO_STDERR)
58 # define STDERR_FILENO (_LLIO_STDERR)
59 # endif
60 #endif
62 // Place all additions (especially function declarations) within extern "C" {}
63 #ifdef __cplusplus
64 extern "C"
66 #endif /* __cplusplus */
68 #if defined (ACE_WIN32)
69 // The following are #defines and #includes that are specific to
70 // WIN32.
71 # define ACE_STDIN GetStdHandle (STD_INPUT_HANDLE)
72 # define ACE_STDOUT GetStdHandle (STD_OUTPUT_HANDLE)
73 # define ACE_STDERR GetStdHandle (STD_ERROR_HANDLE)
74 // The following are #defines and #includes that are specific to UNIX.
75 #else /* !ACE_WIN32 */
76 # if defined (STDIN_FILENO)
77 # define ACE_STDIN STDIN_FILENO
78 # else
79 # define ACE_STDIN 0
80 # endif
81 # if defined (STDOUT_FILENO)
82 # define ACE_STDOUT STDOUT_FILENO
83 # else
84 # define ACE_STDOUT 1
85 # endif
86 # if defined (STDERR_FILENO)
87 # define ACE_STDERR STDERR_FILENO
88 # else
89 # define ACE_STDERR 2
90 # endif
91 #endif /* ACE_WIN32 */
93 // for use by access()
94 # if !defined (R_OK)
95 # define R_OK 04 /* Test for Read permission. */
96 # endif /* R_OK */
98 # if !defined (W_OK)
99 # define W_OK 02 /* Test for Write permission. */
100 # endif /* W_OK */
102 # if !defined (X_OK)
103 # if defined (ACE_WIN32)
104 /* Windows has no test for X_OK - use R_OK instead */
105 # define X_OK R_OK /* Test for eXecute permission. */
106 # else /* ACE_WIN32 */
107 # define X_OK 01 /* Test for eXecute permission. */
108 # endif /* ACE_WIN32 */
109 # endif /* X_OK */
111 # if !defined (F_OK)
112 # define F_OK 0 /* Test for existence of File. */
113 # endif /* F_OK */
115 #if defined (ACE_LACKS_GETPGID_PROTOTYPE) && \
116 !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)
117 pid_t getpgid (pid_t pid);
118 #endif /* ACE_LACKS_GETPGID_PROTOTYPE &&
119 !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED */
121 #if defined (__BORLANDC__)
122 # define _isatty isatty
123 #endif /* __BORLANDC__ */
125 # if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES)
127 ssize_t read_timedwait (ACE_HANDLE handle,
128 char *buf,
129 size_t n,
130 struct timespec *timeout);
132 ssize_t write_timedwait (ACE_HANDLE handle,
133 const void *buf,
134 size_t n,
135 struct timespec *timeout);
137 # endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */
139 #ifdef __cplusplus
141 #endif /* __cplusplus */
143 #include /**/ "ace/post.h"
144 #endif /* ACE_OS_INCLUDE_OS_UNISTD_H */