Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
fcntl(2) OSS System Calls Reference Manual
• Clears the close-on-exec flag (FD_CLOEXEC bit) associated with the
new file descriptor so that the file remains open across calls to any func-
tion in the exec, tdm_exec,ortdm_spawn sets of functions.
The value F_DUPFD 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_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:
3−12 Hewlett-Packard Company 527186-023