home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


7.2.26 Fcntl - Load the C fcntl.h Defines

use Fcntl;

$nonblock_flag = O_NDELAY();
$create_flag = O_CREAT();
$read_write_flag = O_RDWR();

This module is just a translation of the C fcntl.h file. Unlike the old mechanism which required a translated fcntl.ph file, fcntl uses the h2xs program (see the Perl source distribution) and your native C compiler. This means that it has a much better chance of getting the numbers right.

Note that only #define symbols get translated; you must still correctly pack up your own arguments to pass as arguments for locking functions and so on.

The following routines are exported by default, and each routine returns the value of the #define that is the same as the routine name:

FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK
F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK
O_APPEND O_CREAT O_EXCL O_NDELAY O_NOCTTY
O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY


Previous: 7.2.25 ExtUtils::MM_VMS - Methods to Override UNIX Behavior in ExtUtils::MakeMaker Programming Perl Next: 7.2.27 File::Basename - Parse File Specifications
7.2.25 ExtUtils::MM_VMS - Methods to Override UNIX Behavior in ExtUtils::MakeMaker Book Index 7.2.27 File::Basename - Parse File Specifications