fcntl

fcntlFILEHANDLE,FUNCTION,SCALAR
This function calls your operating system’s file control
functions, as documented in the fcntl(2) manpage.
Before you call fcntl, you’ll
probably first have to say:
use Fcntl;
to load the correct constant definitions.
SCALAR will be read or written (or
both) depending on the FUNCTION. A pointer to
the string value of SCALAR will be passed as
the third argument of the actual fcntl call. (If
SCALAR has no string value but does have a
numeric value, that value will be passed directly rather than passing a
pointer to the string value.) See the Fcntl module for a description of the more common permissible
values for FUNCTION.
The fcntl function will raise
an exception if used on a system that doesn’t implement
fcntl(2). On systems that do implement it, you can
do such things as modify the close-on-exec flags (if you don’t want to
play with the $^F ($SYSTEM_FD_MAX) variable), modify the
nonblocking I/O flags, emulate the lockf(3) function, and arrange to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access