Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) spt_fcntlx(2)
NAME
spt_fcntlx - Controls open file descriptors (thread-aware version)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <sys/types.h>]
[#include <unistd.h>]
[#include <fcntl.h>]
#include <spthread.h>
int spt_fcntlx (
int filedes,
int request
[ , int argument1 | , struct flock *argument2 ]
);
PARAMETERS
filedes Specifies an open file descriptor obtained from a successful call to the
spt_acceptx(), creat(), dup(), spt_dup2x(), spt_fcntlx(), open(), 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_fcntlx() function is the thread-aware version of the fcntl( ) function.
The spt_fcntlx() 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 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].
527186-023 Hewlett-Packard Company 7159