Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
spt_fcntlz(2) OSS System Calls Reference Manual
NAME
spt_fcntlz - Controls open file descriptors (thread-aware version)
LIBRARY
H-series and J series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
int spt_fcntlz(
int filedes,
int request
[ , int argument1 |
[, struct flock *argument2 |
, struct flock64 *argument2 ]] );
PARAMETERS
filedes Specifies an open file descriptor obtained from a successful call to the
spt_acceptx(), creat(), creat64(), dup(), spt_dup2x(), spt_fcntlz(), open(),
open64(), pipe(), socket(),orsocketpair() function.
request Specifies the operation to be performed.
argument1 Specifies a variable that depends on the value of the request parameter.
argument2 Specifies a variable that depends on the value of the request parameter.
DESCRIPTION
The spt_fcntlz( ) function is a thread aware version of the fcntl( ) function for file descriptors for
non-regular files and for regular files.
The spt_fcntlz( ) function performs controlling operations on the open file specified by the filedes
parameter.
Values for the request parameter are:
F_DUPFD Returns a new file descriptor as listed:
• Returns the lowest-numbered available file descriptor that is greater than
or equal to the argument1 parameter.
• References the same open file description as the original file descriptor.
• Returns the same file pointer as the original file (that is, both file descrip-
tors share one file pointer if the object is a file).
• Returns the same access mode (read, write, or read/write).
• Returns the same file status flags (that is, both file descriptors share the
same file status flags).
• 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].
7−166 Hewlett-Packard Company 527186-023