os_unistd.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_unistd.h
00006  *
00007  *  standard symbolic constants and types
00008  *
00009  *  os_unistd.h,v 1.15 2006/05/05 08:07:39 jwillemsen Exp
00010  *
00011  *  @author Don Hinton <dhinton@dresystems.com>
00012  *  @author This code was originally in various places including ace/OS.h.
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 /* ACE_LACKS_PRAGMA_ONCE */
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 /* __BORLANDC */
00033 
00034 #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)
00035 #  include /**/ <process.h>
00036 #  include /**/ <io.h>
00037 #endif /* ACE_WIN32 && !ACE_HAS_WINCE */
00038 
00039 #if defined (ACE_HAS_SYSINFO)
00040 #  include /**/ <sys/systeminfo.h>
00041 #endif /* ACE_HAS_SYS_INFO */
00042 
00043 #if !defined (ACE_LACKS_UNISTD_H)
00044 #  include /**/ <unistd.h>
00045 #endif /* !ACE_LACKS_UNISTD_H */
00046 
00047 #if defined (ACE_VXWORKS)
00048 #  if !defined (__RTP__)
00049     // for unlink(), close(), read(), write(), lseek(), chdir(), getcwd(),
00050    // getwd(), and isatty()
00051    #  include /**/ <ioLib.h>
00052 #  endif
00053 // for gethostname()
00054 #  include /**/ <hostLib.h>
00055 #endif /* ACE_VXWORKS */
00056 
00057 // Place all additions (especially function declarations) within extern "C" {}
00058 #ifdef __cplusplus
00059 extern "C"
00060 {
00061 #endif /* __cplusplus */
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 /* ACE_LACKS_SETREUID_PROTOTYPE */
00070 
00071 # if defined (ACE_LACKS_SETREGID_PROTOTYPE)
00072   extern int setregid (gid_t rgid, gid_t egid);
00073 # endif /* ACE_LACKS_SETREGID_PROTOTYPE */
00074 #endif  /* !_BSD_SOURCE && !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED
00075            || _XOPEN_SOURCE && __GNUC__ */
00076 
00077   // for use by access()
00078 # if !defined (R_OK)
00079 #   define R_OK    04      /* Test for Read permission. */
00080 # endif /* R_OK */
00081 
00082 # if !defined (W_OK)
00083 #   define W_OK    02      /* Test for Write permission. */
00084 # endif /* W_OK */
00085 
00086 # if !defined (X_OK)
00087 #   define X_OK    01      /* Test for eXecute permission. */
00088 # endif /* X_OK */
00089 
00090 # if !defined (F_OK)
00091 #   define F_OK    0       /* Test for existence of File. */
00092 # endif /* F_OK */
00093 
00094 #if defined (ACE_LACKS_UALARM_PROTOTYPE)
00095    u_int ualarm (u_int usecs, u_int interval);
00096 #endif /* ACE_LACKS_UALARM_PROTOTYPE */
00097 
00098 #if defined (ACE_LACKS_PREAD_PROTOTYPE) && (_XOPEN_SOURCE - 0) < 500
00099    // _XOPEN_SOURCE == 500    Single Unix conformance
00100    // It seems that _XOPEN_SOURCE == 500 means that the prototypes are
00101    // already defined in the system headers.
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  /* ACE_LACKS_PREAD_PROTOTYPE && (_XOPEN_SOURCE - 0) < 500 */
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  /* ACE_LACKS_GETPGID_PROTOTYPE &&
00117            !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED */
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  /* _LARGEFILE64_SOURCE */
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 /* __BORLANDC__ */
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 /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */
00153 
00154 #if defined (ACE_LACKS_SWAB_PROTOTYPE)
00155   void swab(const void *, void *, ssize_t);
00156 #endif /* ACE_LACKS_SWAB_PROTOTYPE */
00157 
00158 #if defined (ACE_LACKS_GETOPT_PROTOTYPE)
00159   int getopt(int, char * const [], const char *);
00160 #endif /* ACE_LACKS_GETOPT_PROTOTYPE */
00161 
00162 #ifdef __cplusplus
00163 }
00164 #endif /* __cplusplus */
00165 
00166 #include /**/ "ace/post.h"
00167 #endif /* ACE_OS_INCLUDE_OS_UNISTD_H */

Generated on Thu Nov 9 09:41:58 2006 for ACE by doxygen 1.3.6