Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (f - i) fcntl(2)
F_GETFD Gets the value of the le descriptor ags, dened in the fcntl.h header le, that
are associated with the value of the ledes parameter. File descriptor ags are
associated with a single le descriptor and do not affect other le descriptors that
refer to the same le. 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 species such a device for the ledes parameter,
the call fails and errno is set to [EINVAL].
F_SETFD Sets the value of the le descriptor ags, dened in the fcntl.h header le, that
are associated with the ledes parameter to the value of the argument1 parame-
ter.
If the FD_CLOEXEC ag in the argument1 parameter is 0 (zero), the le
remains open across calls to any function in the exec, tdm_exec, and
tdm_spawn sets of functions; otherwise, the le is closed on successful execu-
tion of the next function in an exec, tdm_exec,ortdm_spawn function set.
When the FD_CLOEXEC ag is set, no other ag 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 species such a device for the ledes parameter,
the call fails and errno is set to [EINVAL].
F_GETFL Gets the le status ags and le access modes, dened in the fcntl.h header le,
for the le referred to by the ledes parameter.
The le access modes can be extracted by using the mask O_ACCMODE on the
return value. File status ags and le access modes are associated with the le
descriptor and do not affect other le descriptors that refer to the same le with
different open le descriptors.
The argument1 or argument2 parameter is ignored.
The O_APPEND, O_NONBLOCK, and O_SYNC ags are not returned as set
if they were ignored in a previous call using F_SETFL.
F_SETFL Sets the le status ags O_APPEND, O_NONBLOCK, and O_SYNC for the
le to which the ledes parameter refers, from the corresponding bits in the argu-
ment1 parameter. Some ags are ignored, depending on the le type, as listed:
Table 31. Ignored File Status Flags
File type Ignored le status ags
_______________________________________________
O_APPEND, O_NONBLOCK,
O_SYNC
Directory
FIFO, pipe O_APPEND, O_SYNC
Character special le O_APPEND, O_SYNC
Regular le O_NONBLOCK
Socket None; however, see O_ASYNC
note in text.
These le status ags are always accepted and ignored:
O_ACCMODE
O_CREAT
O_EXCL
O_TRUNC
527186-003 Hewlett-Packard Company 33