fcntl.html
来自「perl教程」· HTML 代码 · 共 91 行
HTML
91 行
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../displayToc.js"></script>
<script language="JavaScript" src="../tocParas.js"></script>
<script language="JavaScript" src="../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../scineplex.css">
<title>Fcntl - load the C Fcntl.h defines</title>
<link rel="stylesheet" href="../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',1);</script>
<h1><a>Fcntl - load the C Fcntl.h defines</a></h1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#note">NOTE</a></li>
<li><a href="#exported_symbols">EXPORTED SYMBOLS</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Fcntl - load the C Fcntl.h defines</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
<span class="keyword">use</span> <span class="variable">Fcntl</span><span class="operator">;</span>
<span class="keyword">use</span> <span class="variable">Fcntl</span> <span class="string">qw(:DEFAULT :flock)</span><span class="operator">;</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This module is just a translation of the C <em>fcntl.h</em> file.
Unlike the old mechanism of requiring a translated <em>fcntl.ph</em>
file, this uses the <strong>h2xs</strong> program (see the Perl source distribution)
and your native C compiler. This means that it has a
far more likely chance of getting the numbers right.</p>
<p>
</p>
<hr />
<h1><a name="note">NOTE</a></h1>
<p>Only <code>#define</code> symbols get translated; you must still correctly
pack up your own arguments to pass as args for locking functions, etc.</p>
<p>
</p>
<hr />
<h1><a name="exported_symbols">EXPORTED SYMBOLS</a></h1>
<p>By default your system's F_* and O_* constants (eg, F_DUPFD and
O_CREAT) and the FD_CLOEXEC constant are exported into your namespace.</p>
<p>You can request that the <a href="../lib/Pod/perlfunc.html#item_flock"><code>flock()</code></a> constants (LOCK_SH, LOCK_EX, LOCK_NB
and LOCK_UN) be provided by using the tag <code>:flock</code>. See <a href="../lib/Exporter.html">the Exporter manpage</a>.</p>
<p>You can request that the old constants (FAPPEND, FASYNC, FCREAT,
FDEFER, FEXCL, FNDELAY, FNONBLOCK, FSYNC, FTRUNC) be provided for
compatibility reasons by using the tag <code>:Fcompat</code>. For new
applications the newer versions of these constants are suggested
(O_APPEND, O_ASYNC, O_CREAT, O_DEFER, O_EXCL, O_NDELAY, O_NONBLOCK,
O_SYNC, O_TRUNC).</p>
<p>For ease of use also the SEEK_* constants (for <a href="../lib/Pod/perlfunc.html#item_seek"><code>seek()</code></a> and sysseek(),
e.g. SEEK_END) and the S_I* constants (for <a href="../lib/Pod/perlfunc.html#item_chmod"><code>chmod()</code></a> and <a href="../lib/Pod/perlfunc.html#item_stat"><code>stat())</code></a> are
available for import. They can be imported either separately or using
the tags <code>:seek</code> and <code>:mode</code>.</p>
<p>Please refer to your native fcntl(2), open(2), fseek(3), <code>lseek(2)</code>
(equal to Perl's <a href="../lib/Pod/perlfunc.html#item_seek"><code>seek()</code></a> and sysseek(), respectively), and <a href="../lib/Pod/perlfunc.html#item_chmod"><code>chmod(2)</code></a>
documentation to see what constants are implemented in your system.</p>
<p>See <a href="../lib/Pod/perlopentut.html">the perlopentut manpage</a> to learn about the uses of the O_* constants
with sysopen().</p>
<p>See <a href="../lib/Pod/perlfunc.html#seek">seek in the perlfunc manpage</a> and <a href="../lib/Pod/perlfunc.html#sysseek">sysseek in the perlfunc manpage</a> about the SEEK_* constants.</p>
<p>See <a href="../lib/Pod/perlfunc.html#stat">stat in the perlfunc manpage</a> about the S_I* constants.</p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?