Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_fcntlz(2)
F_GETFD Gets the value of the file descriptor flags, defined in the fcntl.h header file, that
are associated with the value of the filedes parameter. File descriptor flags are
associated with a single file descriptor and do not affect other file descriptors that
refer to the same file. The argument1 parameter or argument2 parameter is
ignored.
The value F_GETFD is invalid for an OSSTTY or Telserv terminal device. If
this value is used in a call that specifies such a device for the filedes parameter,
the call fails and errno is set to [EINVAL].
F_SETFD Sets the value of the file descriptor flags, defined in the fcntl.h header file, that
are associated with the filedes parameter to the value of the argument1 parame-
ter.
If the FD_CLOEXEC flag in the argument1 parameter is 0 (zero), the file
remains open across calls to any function in the exec, tdm_exec, and
tdm_spawn sets of functions; otherwise, the file is closed on successful execu-
tion of the next function in an exec, tdm_exec,ortdm_spawn function set.
When the FD_CLOEXEC flag is set, no other flag can be set in the call.
The value F_SETFD is invalid for an OSSTTY or Telserv terminal device. If
this value is used in a call that specifies such a device for the filedes parameter,
the call fails and errno is set to [EINVAL].
F_GETFL Gets the file status flags and file access modes, defined in the fcntl.h header file,
for the file referred to by the filedes parameter.
The file access modes can be extracted by using the mask O_ACCMODE on the
return value. File status flags and file access modes are associated with the file
descriptor and do not affect other file descriptors that refer to the same file with
different open file descriptors.
The argument1 or argument2 parameter is ignored.
The O_APPEND, O_NONBLOCK, and O_SYNC flags are not returned as set
if they were ignored in a previous call using F_SETFL.
F_SETFL Sets the file status flags O_APPEND, O_NONBLOCK, and O_SYNC for the
file to which the filedes parameter refers, from the corresponding bits in the
argu-
ment1 parameter.
Some flags are ignored, depending on the file type, as listed:
Table 7−2. Ignored File Status Flags
File type Ignored file status flags
_______________________________________________
O_APPEND, O_NONBLOCK,
O_SYNC
Directory
FIFO, pipe O_APPEND, O_SYNC
Character special file O_APPEND, O_SYNC
Regular file O_NONBLOCK
Socket O_APPEND, O_SYNC
These file status flags are always accepted and ignored:
O_ACCMODE
O_CREAT
O_EXCL
O_TRUNC
527186-023 Hewlett-Packard Company 7−167