#ifndef __UNISTD_LOADED #define __UNISTD_LOADED 1 /**************************************************************************** ** ** - Standard symbolic constants and types ** ***************************************************************************** ** Header introduced by the ISO POSIX-1 Standard ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** X/Open extended (XPG4) typedefs, new in DEC C V5.n */ #if defined _XOPEN_SOURCE_EXTENDED || \ (!defined _POSIX_C_SOURCE && !defined _DECC_V4_SOURCE) # ifndef __USECONDS_T # define __USECONDS_T typedef __useconds_t useconds_t; # endif #endif /* ** Create 'public' typedefs that are sensitive to pointer size and must ** use 32 bit pointers. Create other declarations which are not sensitive ** to pointer size. */ #ifndef NULL # define NULL __NULL #endif /* ** ISO POSIX-1 Defines for the Access() mode argument */ #define F_OK 0 #define X_OK 1 #define W_OK 2 #define R_OK 4 /* ** ISO POSIX-1 Seek modes. */ #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 /* ** ISO POSIX-1 File descriptor numbers for stdin, stdout and stderr */ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 /* ** ISO POSIX-1 Constants for portability specifications */ #define _POSIX_VERSION 199506L /* IEEE Std 1003.1c-1995 */ #define _POSIX_JOB_CONTROL (-1) /* Support for job control */ #define _POSIX_SAVED_IDS (-1) /* Save set-user-id,set-group-id */ #define _POSIX_CHOWN_RESTRICTED 1 /* chown requires privilege */ #define _POSIX_NO_TRUNC (-1) /* pathnames are truncated */ #define _POSIX_VDISABLE (-1) /* tcgetattr not supported */ /* ** ISO POSIX-1 Symbolic constants for the [f]pathconf() function */ #define _PC_CHOWN_RESTRICTED 0 #define _PC_LINK_MAX 1 #define _PC_MAX_CANON 2 #define _PC_MAX_INPUT 3 #define _PC_NAME_MAX 4 #define _PC_NO_TRUNC 5 #define _PC_PATH_MAX 6 #define _PC_PIPE_BUF 7 #define _PC_VDISABLE 8 /* ** ISO POSIX-1 Symbolic constants for the sysconf() function */ #define _SC_ARG_MAX 100 #define _SC_CHILD_MAX 101 #define _SC_CLK_TCK 102 #define _SC_NGROUPS_MAX 103 #define _SC_OPEN_MAX 104 #define _SC_STREAM_MAX 105 #define _SC_TZNAME_MAX 106 #define _SC_JOB_CONTROL 107 #define _SC_SAVED_IDS 108 #define _SC_VERSION 109 #if _POSIX_C_SOURCE >= 2 || !defined _POSIX_C_SOURCE /* ** ISO POSIX-2 configuration values */ # define _POSIX2_C_VERSION 199209L /* IEEE Std 1003.2-1992 */ # define _POSIX2_VERSION 199209L /* POSIX.2 standard */ # define _POSIX2_C_BIND 1 /* Support C language binding */ # define _POSIX2_C_DEV (-1) /* Support C development env */ # define _POSIX2_CHAR_TERM 1 /* Support at least one terminal */ # define _POSIX2_FORT_DEV (-1) /* Support FORTRAN development */ # define _POSIX2_FORT_RUN (-1) /* Support FORTRAN runtime */ # define _POSIX2_LOCALEDEF 1 /* Support creation of locales */ # define _POSIX2_SW_DEV (-1) /* Support software development */ # define _POSIX2_UPE (-1) /* Support User Portability Env */ /* ** ISO POSIX-2 Symbolic constants for sysconf() */ # define _SC_BC_BASE_MAX 121 # define _SC_BC_DIM_MAX 122 # define _SC_BC_SCALE_MAX 123 # define _SC_BC_STRING_MAX 124 # define _SC_COLL_WEIGHTS_MAX 125 # define _SC_EXPR_NEST_MAX 126 # define _SC_LINE_MAX 127 # define _SC_RE_DUP_MAX 128 # define _SC_2_VERSION 129 # define _SC_2_C_BIND 130 # define _SC_2_C_DEV 131 # define _SC_2_FORT_DEV 132 # define _SC_2_SW_DEV 133 # define _SC_2_FORT_RUN 134 # define _SC_2_LOCALEDEF 135 # define _SC_2_UPE 136 #if __CRTL_VER >= 70300010 # define _SC_GETGR_R_SIZE_MAX 150 #endif /* ** ISO POSIX-2 Symbolic constants for the confstr() function */ # define _CS_PATH 0 /* ** ISO POSIX-2 option parsing state variables */ # if (__CRTL_VER >= 60200000) # pragma __extern_model __save # pragma __extern_model __strict_refdef extern int optind; extern int opterr; extern int optopt; extern char *optarg; # pragma __extern_model __restore # endif #endif #if _POSIX_C_SOURCE >= 199506 || !defined _POSIX_C_SOURCE /* ** POSIX 1003.1c-1995 configuration values. */ # define _POSIX_THREADS /* 1003.4a (pthreads) comformant */ # define _POSIX_THREAD_ATTR_STACKSIZE /* Support spec stack size */ # define _POSIX_THREAD_PRIORITY_SCHEDULING /* Support realtime scheduling */ /* ** Thread-safe ANSI C functions from POSIX 1003.1c not ** implemented at this time. ** # define _POSIX_THREAD_SAFE_FUNCTIONS */ /* ** POSIX 1003.1c-1995 Symbolic constants for sysconf() */ # define _SC_THREAD_DESTRUCTOR_ITERATIONS 140 # define _SC_THREAD_KEYS_MAX 141 # define _SC_THREAD_STACK_MIN 142 # define _SC_THREAD_THREADS_MAX 143 # define _SC_THREAD_SAFE_FUNCTIONS 144 # define _SC_THREADS 145 # define _SC_THREAD_ATTR_STACKSIZE 146 # define _SC_THREAD_PRIORITY_SCHEDULING 147 #endif #if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE /* ** X/Open configuration variables */ # define _XOPEN_VERSION 4 /* XPG4 */ # define _XOPEN_XCU_VERSION -1 /* Version of XCU */ # define _XOPEN_XPG4_EXTENDED -1 /* not fully provided */ # define _XOPEN_CRYPT -1 /* Supports X/Open Encryption FG */ # define _XOPEN_ENH_I18N 1 /* Supports Enhanced Internat FG */ # define _XOPEN_SHM -1 /* Supports Shared Memory FG */ /* ** X/Open Symbolic constants for the sysconf() function */ # define _SC_XOPEN_VERSION 110 # define _SC_PASS_MAX 111 # define _SC_XOPEN_CRYPT 118 # define _SC_XOPEN_ENH_I18N 119 # define _SC_XOPEN_SHM 120 #endif #if defined _XOPEN_SOURCE_EXTENDED || !defined _POSIX_C_SOURCE /* ** X/Open Extended (XPG4 V2) configuration variables */ # define _XOPEN_UNIX 1 /* Supports XSH4 extended feature*/ /* ** X/Open Extended (XPG4 V2) symbolic constants for sysconf() function */ # define _SC_PAGESIZE 117 # define _SC_PAGE_SIZE _SC_PAGESIZE # define _SC_ATEXIT_MAX 138 /* not in POSIX, but in XPG4 */ # define _SC_IOV_MAX 139 /* not in POSIX, but in XPG4 */ # define _SC_XOPEN_UNIX 148 #endif /* ** DEC C extensions */ #ifndef _POSIX_C_SOURCE /* ** Constants for sysconf() */ /* ** definitions for the MP extensions to sysconf() */ # define _SC_NPROC_CONF 200 # define _SC_NPROCESSORS_CONF _SC_NPROC_CONF # define _SC_NPROC_ONLN 201 # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN # define _SC_2_C_VERSION _SC_2_VERSION # define _SC_2_CHAR_TERM 137 # ifdef __NOT_YET_IMPLEMENTED # define _SC_DELAYTIMER_MAX 112 # define _SC_TIMER_MAX 113 # define _SC_MAPPED_FILES 114 # define _SC_FSYNC 115 # define _SC_TIMERS 116 # endif /* ** Symbolic constants for the [f]pathconf() function */ # ifdef __NEED_MORE_INFO # define _PC_ASYNC_IO 9 # define _PC_PRIO_IO 10 # define _PC_SYNC_IO 11 # endif #endif /* ** ISO POSIX-1 typedefs */ #if !defined __SIZE_T && !defined _DECC_V4_SOURCE # define __SIZE_T 1 typedef __size_t size_t; #endif #if !defined __SSIZE_T && !defined _DECC_V4_SOURCE # define __SSIZE_T 1 typedef __ssize_t ssize_t; #endif /* ** X/Open (XPG4) typedefs */ #if defined _XOPEN_SOURCE || \ (!defined _POSIX_C_SOURCE && !defined _DECC_V4_SOURCE) # ifndef __GID_T # define __GID_T 1 typedef __gid_t gid_t; # endif # ifndef __OFF_T # define __OFF_T 1 typedef __off_t off_t; # endif # ifndef __PID_T # define __PID_T 1 typedef __pid_t pid_t; # endif # ifndef __UID_T # define __UID_T 1 typedef __uid_t uid_t; # endif #endif /* ** ISO POSIX-2 functions that do not support 64-bit pointers */ #if _POSIX_C_SOURCE >= 2 || !defined _POSIX_C_SOURCE # if __CRTL_VER >= 60200000 /* Supported starting with OpenVMS V6.2 */ int getopt (int __argc, char * const __argv[], const char *__optstring); # endif #endif /* ** We are done defining things which must always be 32 bit pointers. If the ** user has used /pointer_size=32 or /pointer_size=64, we will allow 64 bit ** pointers to be used in function calls. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** ISO POSIX-1 function prototypes */ #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #endif int access (const char *__file_spec, int __mode); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif int close (int __file_desc); int dup2 (int __file_desc1, int __file_desc2); int dup (int __file_desc); int execv (const char *__path, __char_ptr_const_ptr32 __argv); int execve (const char *__path, __char_ptr_const_ptr32 __argv, __char_ptr_const_ptr32 __envp); int execvp (const char *__file, __char_ptr_const_ptr32 __argv); int isatty (int __file_desc); __off_t lseek (int __file_desc, __off_t __offset, int __direction); int pause (void); #ifdef _POSIX_C_SOURCE int pipe (int __array_fdscptr[2]); #else int pipe (int __array_fdscptr[2], ...); #endif int rmdir (const char *__path); #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #endif __gid_t getegid (void); __gid_t getgid (void); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif __pid_t getpid (void); __pid_t getppid (void); #if __CRTL_VER >= 70000000 && !defined(_VMS_V6_SOURCE) # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__posix_" # else # define _exit(__p1) __posix__exit(__p1) # endif #endif void _exit (int status); #if __CRTL_VER >= 70000000 && !defined(_VMS_V6_SOURCE) # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif #endif #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #elif __CRTL_VER >= 70000000 && !defined(_VMS_V6_SOURCE) # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__unix_" # else # define geteuid() __unix_geteuid() # define getuid() __unix_getuid() # endif #endif __uid_t geteuid (void); __uid_t getuid (void); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #elif __CRTL_VER >= 70000000 && !defined(_VMS_V6_SOURCE) # if __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif #endif /* ** X/Open functions */ #if defined _XOPEN_SOURCE_EXTENDED || !defined _POSIX_C_SOURCE # if defined _DECC_V4_SOURCE int gethostname (char *__name, int __namelen); # else int gethostname (char *__name, __size_t __namelen); # endif #endif /* ** The following functions always return a 32 bit pointer */ #if __CRTL_VER >= 70000000 __char_ptr32 getlogin(void); #endif /* ** X/Open Extended functions always returning 32 bit pointers */ #if defined _XOPEN_SOURCE_EXTENDED || !defined _POSIX_C_SOURCE __void_ptr32 sbrk (long int __incr); #endif /* ** The following functions have interfaces of XXX, _XXX32, and _XXX64 due only ** to the fact that the return argument is a pointer that is relative to one ** of the arguments. */ #if __INITIAL_POINTER_SIZE == 32 #pragma __pointer_size 32 #endif /* ISO POSIX-1 functions */ char *ctermid (char *__str); #if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE char *cuserid (char *__str); #endif #ifdef _POSIX_C_SOURCE char *getcwd(char *__buffer, __size_t __size); #else char *getcwd(char *__buffer, unsigned int __size, ...); #endif #if __INITIAL_POINTER_SIZE == 32 #pragma __pointer_size 64 #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size 32 char *_ctermid32 (char *__str); char *_cuserid32 (char *__str); char *_getcwd32 (char *__buffer, unsigned int __size, ...); # pragma __pointer_size 64 char *_ctermid64 (char *__str); char *_cuserid64 (char *__str); char *_getcwd64 (char *__buffer, unsigned int __size, ...); #endif /* ** DEC C V5.2 changed the prototypes to ISO POSIX-1 definitions in a way ** that was binary upward compatible but not source upward compatibile. ** The old definitions are retained for compatibility with old source. */ #ifndef _DECC_V4_SOURCE #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #endif int chown (const char *__file_spec, __uid_t __owner, __gid_t __group); int setgid (__gid_t); int setuid (__uid_t); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif unsigned int alarm (unsigned int __seconds); __ssize_t read (int __file_desc, void *__buffer, __size_t __nbytes); __ssize_t write (int __file_desc, const void *__buffer, __size_t __nbytes); int execl (const char *__path, const char *arg0, ...); int execle (const char *__path, const char *arg0, ...); int execlp (const char *__path, const char *arg0, ...); unsigned int sleep (unsigned __seconds); #else int alarm (unsigned int __seconds); int chown (const char *__file_spec, unsigned int __owner, unsigned int __group); int read (int __file_desc, void *__buffer, int __nbytes); int write (int __file_desc, void *__buffer, int __nbytes); int execl (char *__name, ...); int execle (char *__name, ...); int execlp (char *__name, ...); __gid_t setgid (__gid_t); __uid_t setuid (__uid_t); int sleep (unsigned __seconds); #endif #if __CRTL_VER >= 70000000 long int fpathconf (int __fd, int __name); long int pathconf (const char * __path, int __name); long int sysconf (int __name); int unlink (const char *__path); #endif /* ** ISO POSIX-2 function prototypes */ #if _POSIX_C_SOURCE >=2 || !defined _POSIX_C_SOURCE # if __CRTL_VER >= 70000000 __size_t confstr (int __name, char * __buf, __size_t __len); # endif #endif /* ** X/Open (XPG4) function prototypes */ #if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE int fsync (int __file_desc); int nice (int __increment); # if __CRTL_VER >= 70000000 void swab (const void * __src, void * __dst, __ssize_t __nbytes); # endif # if __CRTL_VER >= 70300000 #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #endif int fchown(int __fildes, __uid_t __owner, __gid_t __group); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif int link(const char *__existing, const char *__new); # endif # if __USE_LONG_GID_T __pid_t getpgid (__pid_t); __pid_t getpgrp (void); __pid_t getsid (__pid_t); int seteuid (__uid_t); int setpgid (__pid_t, __pid_t); __pid_t setpgrp (void); int setregid (__gid_t, __gid_t); int setreuid (__uid_t, __uid_t); __pid_t setsid (void); # endif #endif /* ** X/Open extended (XPG4 V2) function prototypes */ #if defined _XOPEN_SOURCE_EXTENDED || !defined _POSIX_C_SOURCE # if __CRTL_VER >= 70000000 int ftruncate (int __filedes, __off_t __length ); int getdtablesize (void); int getpagesize (void); int truncate (const char *__path, __off_t __length ); __useconds_t ualarm (__useconds_t __useconds, __useconds_t __interval); int usleep (__useconds_t __useconds); # endif # ifdef __ALPHA # define lib$get_current_invo_context LIB$GET_CURRENT_INVO_CONTEXT __int64_ptr32 decc$$get_vfork_jmpbuf(void); int lib$get_current_invo_context(__int64_ptr32 __invo_context); int decc$$alloc_vfork_blocks(void); # define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) # else # ifndef _DECC_V4_SOURCE __pid_t vfork(void); # else int vfork(void); # endif # endif #endif /* ** DEC C extensions ** ** chdir has an additional parameter as a DEC C extension. */ #ifdef _POSIX_C_SOURCE int chdir (const char *__dir_spec); #else int chdir (const char *__dir_spec, ...); #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __UNISTD_LOADED */