#ifndef __UNIXIO_LOADED #define __UNIXIO_LOADED 1 /***************************************************************************** ** ** - Prototypes for UNIX emulation functions ** ****************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright 2003 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries 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. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif #include /* Definition of rename */ #include /* Definition of stat, fstat, stat_t */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Types shared with */ #if !defined __SIZE_T && !defined _DECC_V4_SOURCE # define __SIZE_T 1 #ifdef __NAMESPACE_STD namespace std { #endif typedef __size_t size_t; #ifdef __NAMESPACE_STD } /* namespace std */ using std::size_t; #endif #endif #if !defined __SSIZE_T && !defined _DECC_V4_SOURCE # define __SSIZE_T 1 typedef __ssize_t ssize_t; #endif #if !defined __MODE_T && !defined _DECC_V4_SOURCE # define __MODE_T 1 typedef __mode_t mode_t; #endif #if !defined __UID_T && !defined _DECC_V4_SOURCE # define __UID_T 1 typedef __uid_t uid_t; #endif #if !defined __GID_T && !defined _DECC_V4_SOURCE # define __GID_T 1 typedef __gid_t gid_t; #endif #if !defined __OFF_T && !defined _DECC_V4_SOURCE # define __OFF_T 1 typedef __off_t off_t; #endif /* ** Defines for the Access() mode argument */ #define F_OK 0 #define X_OK 1 #define W_OK 2 #define R_OK 4 /* ** Functions which return pointers into CRTL owned memory always return a ** short pointer, regardless of application compilation mode. */ #if __CRTL_VER >= 70320000 && __POSIX_TTYNAME char *ttyname(int fd); /* Enforces 1 argument */ #else char *ttyname(); /* Legacy supports zero or 1 arguments */ #endif /* ** We are done defining things which must always be short pointers. If the ** user has used /pointer_size=short or /pointer_size=long, we will allow long ** pointers to be used in function calls. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** Functions which accept either 32 or 64 bits pointers */ #if __USE_LONG_GID_T # pragma __extern_prefix __save # pragma __extern_prefix "__long_gid_" #endif int access (const char *__file_spec, int __mode); int chmod (const char *__file_spec, __mode_t __mode); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif int close (int __file_desc); int dup (int __file_desc); int dup2 (int __file_desc1, int __file_desc2); int isapipe (int __file_desc); int isatty (int __file_desc); #if __USE_OFF64_T # pragma __extern_prefix __save # pragma __extern_prefix "__off64_" #endif __off_t lseek (int __file_desc, __off_t __offset, int __direction); #if __USE_OFF64_T # pragma __extern_prefix __restore #endif /* ** The function open in DEC C V4.0 had a required mode_t parameter if in ** strict ANSI mode. This is not standard conforming, so it it here for ** compatibility only. */ #if defined _DECC_V4_SOURCE && defined __HIDE_FORBIDDEN_NAMES int open (const char *__file_spec, int __flags, __mode_t __mode, ...); #else int open (const char *__file_spec, int __flags, ...); #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); #if __USE_LONG_GID_T # pragma __extern_prefix __restore #endif __ssize_t read (int __file_desc, void *__buffer, __size_t __nbytes); __ssize_t write (int __file_desc, const void *__buffer, __size_t __nbytes); #else 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); #endif /* ** DEC C extensions which have additional parameters as a DEC C extension. */ #ifdef _POSIX_C_SOURCE int chdir (const char *__dir_spec); int creat (const char *__file_spec, __mode_t __mode); #else int chdir (const char *__dir_spec, ...); int creat (const char *__file_spec, __mode_t __mode, ...); #endif /* ** The following function is not available in C++. */ #ifndef __cplusplus int delete(const char *__file_spec); #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 char *getname (int __file_desc, char *__buffer, ...); char *mktemp (char *__template); #if __INITIAL_POINTER_SIZE && __CRTL_VER >= 70000000 # pragma __pointer_size 32 char *_getname32 (int, char *, ...); char *_mktemp32 (char *); # pragma __pointer_size 64 char *_getname64 (int, char *, ...); char *_mktemp64 (char *); #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __UNIXIO_LOADED */