⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unistd.h.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>&lt;unistd.h&gt;</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><xref type="10" name="unistd"></xref><h4><a name = "tag_000_010_274">&nbsp;</a>NAME</h4><blockquote>unistd.h - standard symbolic constants and types</blockquote><h4><a name = "tag_000_010_275">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;unistd.h&gt;</code></pre></blockquote><h4><a name = "tag_000_010_276">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>&lt;unistd.h&gt;</i>header defines miscellaneous symbolic constants and types,and declares miscellaneous functions.The contents of this header are shown below.<h5><a name = "tag_000_010_276_001">&nbsp;</a>Version Test Macros</h5>The following symbolic constants are defined:<dl compact><dt>_POSIX_VERSION<dd>Integer value indicating version of the ISO&nbsp;POSIX-1 standard (C language binding).<dt>_POSIX2_VERSION<dd>Integer value indicating version of the ISO POSIX-2 standard (Commands).<dt>_POSIX2_C_VERSION<dd>Integer value indicating version of the ISO POSIX-2 standard (C language binding).<dt>_XOPEN_VERSION<dd>Integer value indicating version of the X/Open Portability Guideto which the implementation conforms.</dl><p>_POSIX_VERSION is defined in the ISO&nbsp;POSIX-1 standard.It changes with each new version of the ISO&nbsp;POSIX-1 standard.<p>_POSIX2_VERSION is defined to have the value of the ISO POSIX-2 standard'sPOSIX2_VERSION limit. It changes with each new version of the ISO POSIX-2 standard.<p>_POSIX2_C_VERSION is defined in the ISO POSIX-2 standard.It changes with each new version of the ISO POSIX-2 standard.When the C language binding option of theISO POSIX-2 standard and therefore the X/Open POSIX2 C-language BindingFeature Group is not supported,_POSIX2_C_VERSION will be set to -1.<p>_XOPEN_VERSION is defined as an integer value equal to 500.<p>_XOPEN_XCU_VERSION is defined as an integer value indicating the version ofthe <b>XCU</b> specification to which the implementation conforms.If the value is -1, no commands and utilities are provided on theimplementation.  If the value is greaterthan or equal to 4, the functionality associated with the following symbolsis also supported (see<xref href=mand_sym><a href="#tag_000_010_276_002">Mandatory Symbolic Constants</a></xref>and<xref href=opt_sym><a href="#tag_000_010_276_003">Constants for Options and Feature Groups</a></xref>):<pre>_POSIX2_C_BIND_POSIX2_C_VERSION_POSIX2_CHAR_TERM_POSIX2_LOCALEDEF_POSIX2_UPE_POSIX2_VERSION</pre><p>If this constant is not defined use the<i><a href="sysconf.html">sysconf()</a></i>function to determine which features are supported.<p>Each of the following symbolic constants is defined only if theimplementation supports the indicated issue of the X/Open PortabilityGuide:<dl compact><dt>_XOPEN_XPG2<dd>X/Open Portability Guide, Volume 2, January 1987,XVS System Calls and Libraries(ISBN:&nbsp;0-444-70175-3).<dt>_XOPEN_XPG3<dd>X/Open Specification, February 1992,System Interfaces and Headers, Issue 3(ISBN:&nbsp;1-872630-37-5, C212); this specification was formerlyX/Open Portability Guide, Issue 3, Volume 2, January 1989, XSI System Interface and Headers(ISBN:&nbsp;0-13-685843-0, XO/XPG/89/003).<dt>_XOPEN_XPG4<dd>X/Open CAE Specification, July 1992, System Interfaces and Headers, Issue 4(ISBN:&nbsp;1-872630-47-2, C202).<dt>_XOPEN_UNIX<dd>X/Open CAE Specification, January 1997,System Interfaces and Headers, Issue 5(ISBN:&nbsp;1-85912-181-0, C606).</dl><h5><a name = "tag_000_010_276_002">&nbsp;</a>Mandatory Symbolic Constants</h5><xref type="5" name="mand_sym"></xref>Although all implementations conforming to this specification supportall of the FIPS features described below, there may be system-dependent orfile-system-dependent configuration procedures that can remove or modify anyor all of these features.  Such configurations should not be made if strictFIPS compliance is required.<p>The following symbolic constants are either undefined or defined with avalue other than -1. If a constant is undefined, an application shoulduse the<i><a href="sysconf.html">sysconf()</a></i>,<i><a href="pathconf.html">pathconf()</a></i>or<i><a href="fpathconf.html">fpathconf()</a></i>functions to determine which features are present on the system at that timeor for the particular pathname in question.<dl compact><dt>_POSIX_CHOWN_RESTRICTED<dd>The use of<i><a href="chown.html">chown()</a></i>is restrictedto a process with appropriate privileges, and to changing the group IDof a file only to the effective group ID of the process or to one ofits supplementary group IDs.<dt>_POSIX_NO_TRUNC<dd>Pathname components longer than {NAME_MAX} generate an error.<dt>_POSIX_VDISABLE<dd>Terminal special characters defined in<i><a href="termios.h.html">&lt;termios.h&gt;</a></i>can be disabled using this character value.<dt>_POSIX_SAVED_IDS<dd>Each process has a saved set-user-ID and a saved set-group-ID.<dt>_POSIX_JOB_CONTROL<dd>Implementation supports job control.</dl><p>_POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC and _POSIX_VDISABLEwill have values other than -1.<br><p>The following symbolic constants  are always defined to unspecifiedvalues to indicate that this functionality from the POSIX Threads Extension is alwayspresent on XSI-conformant systems:<dl compact><dt>_POSIX_THREADS<dd>The implementation supports the threads option.<dt>_POSIX_THREAD_ATTR_STACKADDR<dd>The implementation supports the thread stack address attribute option.<dt>_POSIX_THREAD_ATTR_STACKSIZE<dd>The implementation supports the thread stack size attribute option.<dt>_POSIX_THREAD_PROCESS_SHARED<dd>The implementation supports the process-shared synchronisation option.<dt>_POSIX_THREAD_SAFE_FUNCTIONS<dd>The implementation supports the thread-safe functions option.</dl><h5><a name = "tag_000_010_276_003">&nbsp;</a>Constants for Options and Feature Groups</h5><xref type="5" name="opt_sym"></xref><p>The following symbolic constants are defined to have the value -1if the implementation will never provide the feature, and to have avalue other than -1 if the implementation always provides thefeature.If these are undefined, the<i><a href="sysconf.html">sysconf()</a></i>function can be used to determine whether the feature is provided fora particular invocation of the application.<dl compact><dt>_POSIX2_C_BIND<dd>Implementation supports the C Language Binding option.This will always have a value other than -1.<dt>_POSIX2_C_DEV<dd>Implementation supports the C Language Development Utilities option.<dt>_POSIX2_CHAR_TERM<dd>Implementation supports at least one terminal type.<dt>_POSIX2_FORT_DEV<dd>Implementation supports the FORTRAN Development Utilities option.<dt>_POSIX2_FORT_RUN<dd>Implementation supports the FORTRAN Run-time Utilities option.<dt>_POSIX2_LOCALEDEF<dd>Implementation supports the creation of locales by the<i><a href="../xcu/localedef.html">localedef</a></i>utility.<dt>_POSIX2_SW_DEV<dd>Implementation supports the Software Development Utilities option.<dt>_POSIX2_UPE<dd>The implementation supports the User Portability Utilities option.<dt>_XOPEN_CRYPT<dd>The implementation supports the X/Open Encryption Feature Group.<dt>_XOPEN_ENH_I18N<dd>The implementation supports the Issue 4, Version 2 Enhanced InternationalisationFeature Group.This is always set to a value other than -1.<dt>_XOPEN_LEGACY<dd>The implementation supports the Legacy Feature Group.<dt>_XOPEN_REALTIME<dd>The implementation supports the X/Open Realtime Feature Group.<dt>_XOPEN_REALTIME_THREADS<dd>The implementation supports the X/Open Realtime Threads Feature Group.<dt>_XOPEN_SHM<dd>The implementation supports the Issue 4, Version 2 Shared Memory Feature Group.This is always set to a value other than -1.<dt>_XBS5_ILP32_OFF32<dd>Implementation provides a C-language compilation environment with 32-bit<b>int</b>,<b>long</b>,<b>pointer</b>and<b>off_t</b>types.<dt>_XBS5_ILP32_OFFBIG<dd>Implementation provides a C-language compilation environment with 32-bit<b>int</b>,<b>long</b>and<b>pointer</b>types and an<b>off_t</b>type using at least 64 bits.<dt>_XBS5_LP64_OFF64<dd>Implementation provides a C-language compilation environment with32-bit<b>int</b>and 64-bit<b>long</b>,<b>pointer</b>and<b>off_t</b>types.<dt>_XBS5_LPBIG_OFFBIG<dd>Implementation provides a C-language compilation environment with an<b>int</b>type using at least 32 bits and<b>long</b>,<b>pointer</b>and<b>off_t</b>types using at least 64 bits.</dl><p>If _XOPEN_REALTIME is defined to have a value other than -1, thenthe following symbolic constants will be defined to an unspecifiedvalue to indicate that the features are supported.<dl compact><dt>_POSIX_ASYNCHRONOUS_IO<dd>Implementation supports the Asynchronous Input and Output option.<dt>_POSIX_MEMLOCK<dd>Implementation supports the Process Memory Locking option.<dt>_POSIX_MEMLOCK_RANGE<dd>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -