#ifndef __FCNTL_LOADED #define __FCNTL_LOADED /**************************************************************************** ** ** - File control information ** ***************************************************************************** ** 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 64 #endif /* ** `cmd' values for fcntl() */ #define F_DUPFD 0 #define F_GETFD 1 #define F_SETFD 2 #define F_GETFL 3 #define F_SETFL 4 #define F_GETLK 7 #define F_SETLK 8 #define F_SETLKW 9 /* ** File descriptor flags used for fcntl() */ #define FD_CLOEXEC 1 /* ** `l_type' values for record locking with fcntl() */ #define F_RDLCK 1 #define F_WRLCK 2 #define F_UNLCK 3 /* ** ISO POSIX-1 defines some values for the flags argument to open() ** and specifies that they reside here. For compatibility with ** DEC C V5.0 and prior, the an old set of flags is duplicated in */ /* ** This group is shared with */ #ifndef O_RDONLY # define O_RDONLY 000 # define O_WRONLY 001 # define O_RDWR 002 # define O_APPEND 010 # define O_CREAT 01000 # define O_TRUNC 02000 # define O_EXCL 04000 #endif /* ** This group is not in file.h */ #define O_ACCMODE 003 #define O_NOCTTY 010000 /* not implemented */ #if __CRTL_VER >= 70000000 # define O_NONBLOCK 0100000 #endif /* ** X/Open specifies that this header defines mode_t, pid_t, off_t. Define ** them for X/open mode, or for a default compilation, unless they were ** previously defined or the user requested DECC V4 compatibility. */ #if defined _XOPEN_SOURCE || !defined _POSIX_C_SOURCE # if !defined __MODE_T && !defined _DECC_V4_SOURCE # define __MODE_T typedef __mode_t mode_t; # endif # if !defined __OFF_T && !defined _DECC_V4_SOURCE # define __OFF_T typedef __off_t off_t; # endif # if !defined __PID_T && !defined _DECC_V4_SOURCE # define __PID_T typedef __pid_t pid_t; # endif /* ** Define seek modes. */ # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 /* ** Constants for file status flags for open() and fcntl() */ # define O_SYNC 00040000 /* not implemented */ #endif /* ** DEC C Extensions */ #ifndef _POSIX_C_SOURCE /* ** O_NDELAY is shared with . O_NONBLOCK is the ** standard flag for similar behavior. */ # ifndef O_NDELAY # define O_NDELAY 004 # define O_NOWAIT 004 # endif #endif /* ** structure used in calls to fcntl() */ struct flock { short l_type; short l_whence; __off_t l_start; __off_t l_len; __pid_t l_pid; }; /* ** ISO POSIX-1 function prototypes */ int fcntl (int __fd, int __cmd, ...); /* ** 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 extends creat with extra parameters when not in strict POSIX mode. */ #ifndef _POSIX_C_SOURCE int creat (const char *__file_spec, __mode_t __mode, ...); #else int creat (const char *__file_spec, __mode_t __mode); #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __FCNTL_LOADED */