<?xml version="1.0" encoding="windows-1252"?>
<node id="1111" title="perlman:lib:Fcntl" created="1999-12-22 19:49:26" updated="2005-08-10 16:26:13">
<type id="119">
perlfunc</type>
<author id="113">
root</author>
<data>
<field name="doctext">
</field>
<field name="name">

&lt;P&gt;
Fcntl - load the 
&lt;FONT SIZE=-1&gt;C&lt;/FONT&gt; Fcntl.h defines

&lt;P&gt;
&lt;HR&gt;
</field>
<field name="synopsis">

&lt;P&gt;
&lt;PRE&gt;    use Fcntl;
    use Fcntl qw(:DEFAULT :flock);
&lt;/PRE&gt;
&lt;P&gt;
&lt;HR&gt;
</field>
<field name="description">

&lt;P&gt;
This module is just a translation of the 
&lt;FONT SIZE=-1&gt;C&lt;/FONT&gt; &lt;EM&gt;fnctl.h&lt;/EM&gt; file. Unlike the old mechanism of requiring a translated &lt;EM&gt;fnctl.ph&lt;/EM&gt;
file, this uses the &lt;STRONG&gt;h2xs&lt;/STRONG&gt; program (see the Perl source distribution) and your native 
&lt;FONT SIZE=-1&gt;C&lt;/FONT&gt; compiler. This means that it has a far more likely
chance of getting the numbers right.

&lt;P&gt;
&lt;HR&gt;
&lt;H1&gt;&lt;A NAME="NOTE"&gt;NOTE&lt;/A&gt;&lt;/H1&gt;
&lt;P&gt;
Only &lt;CODE&gt;#define&lt;/CODE&gt; symbols get translated; you must still correctly pack up your own arguments
to pass as args for locking functions, etc.

&lt;P&gt;
&lt;HR&gt;
&lt;H1&gt;&lt;A NAME="EXPORTED_SYMBOLS"&gt;EXPORTED SYMBOLS&lt;/A&gt;&lt;/H1&gt;
&lt;P&gt;
By default your system's 
&lt;FONT SIZE=-1&gt;F_*&lt;/FONT&gt; and 
&lt;FONT SIZE=-1&gt;O_*&lt;/FONT&gt; constants (eg, 
&lt;FONT SIZE=-1&gt;F_DUPFD&lt;/FONT&gt; and 
&lt;FONT SIZE=-1&gt;O_CREAT)&lt;/FONT&gt; and the 
&lt;FONT SIZE=-1&gt;FD_CLOEXEC&lt;/FONT&gt; constant are exported into your namespace.

&lt;P&gt;
You can request that the 
&lt;CODE&gt;flock()&lt;/CODE&gt; constants 
&lt;FONT SIZE=-1&gt;(LOCK_SH,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;LOCK_EX,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;LOCK_NB&lt;/FONT&gt; and 
&lt;FONT SIZE=-1&gt;LOCK_UN)&lt;/FONT&gt; be provided by using the tag
 [perlfunc:flock|flock]. See [perlman:lib:Exporter|Exporter].

&lt;P&gt;
You can request that the old constants 
&lt;FONT SIZE=-1&gt;(FAPPEND,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FASYNC,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FCREAT,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FDEFER,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FEXCL,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FNDELAY,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FNONBLOCK,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FSYNC,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;FTRUNC)&lt;/FONT&gt; be provided for compatibility reasons by using the tag
 &lt;CODE&gt;:Fcompat&lt;/CODE&gt;. For new applications the newer versions of these constants are suggested 
&lt;FONT SIZE=-1&gt;(O_APPEND,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_ASYNC,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_CREAT,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_DEFER,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_EXCL,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_NDELAY,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_NONBLOCK,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_SYNC,&lt;/FONT&gt; 
&lt;FONT SIZE=-1&gt;O_TRUNC).&lt;/FONT&gt;

&lt;P&gt;
Please refer to your native 
&lt;CODE&gt;fcntl()&lt;/CODE&gt; and 
&lt;CODE&gt;open()&lt;/CODE&gt; documentation to see what constants are implemented in your system.

&lt;HR&gt;
</field>
</data>
</node>
