#ifndef __FCNTL_LOADED #define __FCNTL_LOADED /**************************************************************************** ** ** - File control information ** ***************************************************************************** ** Header introduced by the ISO POSIX-1 Standard ***************************************************************************** ** ** Copyright 2005 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 #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 /* SYNCHIO: CRTL now supports synchronized IO using O_SYNC and O_DSYNC flags */ # define O_DSYNC O_SYNC /* On VMS O_DSYNC and O_SYNC are treated identically */ #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 flock used in calls to fcntl(). ** All structures should be member aligned on natural boundaries. ** Note that when compiled with macro _LARGEFILE defined, ** offsets for start and len are longer, the flock structure ** is longer. */ #pragma __member_alignment __save #pragma __member_alignment #define __FLOCK_OFF32_MEMBERS \ short l_type; /* Type of lock */ \ short l_whence; /* Flag for starting offset */ \ __off32_t l_start; /* Relative offset in bytes */ \ __off32_t l_len; /* Size; if 0 then until EOF */ \ __pid_t l_pid; /* Process ID of the process holding the lock */ #define __FLOCK_OFF64_MEMBERS \ short l_type; /* Type of lock */ \ short l_whence; /* Flag for starting offset */ \ __off64_t l_start; /* Relative offset in bytes */ \ __off64_t l_len; /* Size; if 0 then until EOF */ \ __pid_t l_pid; /* Process ID of the process holding the lock */ struct flock { #if __USE_OFF64_T __FLOCK_OFF64_MEMBERS #else __FLOCK_OFF32_MEMBERS #endif }; struct __flock_off32 { __FLOCK_OFF32_MEMBERS }; struct __flock_off64 { __FLOCK_OFF64_MEMBERS }; #pragma __member_alignment __restore /* ** ISO POSIX-1 function prototypes */ #if __USE_OFF64_T && __CRTL_VER >= 80300000 # pragma __extern_prefix __save # pragma __extern_prefix "__off64_" #endif int fcntl (int __fd, int __cmd, ...); #if __USE_OFF64_T && __CRTL_VER >= 80300000 # 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 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 */