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

📄 compilation.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>The Compilation Environment</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><blockquote><center><h3><a name = "tag_000_002">&nbsp;</a>The Compilation Environment</h3></center><xref type="2" name="comp"></xref>Applications should ensure that the feature test macro _XOPEN_SOURCE isdefined with the value 500 before inclusion of any header.  This isneeded to enable thefunctionality described in this specification,and possibly to enable functionality defined elsewhere in the CommonApplications Environment.<p>Identifiers in this specification may only be undefined using the<b>#undef</b>directive as described in<xref href=interface><a href="interfaces.html#tag_000_006">Use and Implementation of Interfaces</a></xref>or<xref href=names><a href="#tag_000_002_001">The X/Open Name Space</a></xref>.These<b>#undef</b>directives must follow all<b>#include</b>directives of any XSI headers.<p>Most strictly conforming POSIX and ISO C applications willcompile on systemscompliant to this specification.  However, an application whichuses any of the items marked as an extension to POSIX andISO C, for any purposeother than that shown here, will not necessarily compile. In such cases,it may benecessary to alter those applications to use alternative identifiers.<p>Since this specification is aligned with the ISO&nbsp;C standard,and since all functionality enabled by _POSIX_C_SOURCEset greater than zero and less than or equal to 199506Lshould be enabled by _XOPEN_SOURCE set equal to 500, there should be noneed to define either _POSIX_SOURCE or _POSIX_C_SOURCE if _XOPEN_SOURCE isso defined.  Therefore if _XOPEN_SOURCE is set equal to 500 and_POSIX_SOURCE is defined, or _POSIX_C_SOURCE is set greater than zeroand less than or equal to 199506L,the behaviour is the same as if only _XOPEN_SOURCE is defined and setequal to 500.However, should _POSIX_C_SOURCE be set to a value greater than199506L, the behaviour is undefined.<h4><a name = "tag_000_002_001">&nbsp;</a>The X/Open Name Space</h4><xref type="3" name="names"></xref>All identifiers in this specification except<i>environ</i>are defined in at least one of the headers, as shown in<xref href=headers></xref>.When _XOPEN_SOURCE is defined, each header defines ordeclares some identifiers, potentiallyconflicting with identifiers used by the application.The set ofidentifiers visible to the application consists of precisely thoseidentifiers from the header pages of the included headers, as wellas additional identifiers reserved for the implementation.In addition, someheaders may make visible identifiers from other headers as indicatedon the relevant header pages.<p>An implementation conforming to the referenced <a href="../xnsix.html">Networking Services, Issue 5</a>specification will define or declare an additional set of identifiersas shown in <a href="../xns/namespace.html">the XNS Name Space</a>or the <a href="../xnsix.html">XNS reference pages</a>.<p>The identifiers reserved for use by the implementation aredescribed below.<ol><p><li>Each identifier with external linkage described in the header sectionis reserved for use as an identifier with external linkage if theheader is included.<p><li>Each macro name described in the header section is reserved forany use if the header is included.<p><li>Each identifier with file scope described in the header section isreserved for use as an identifier with file scope in the samename space if the header is included.<p></ol><p>If any header in the following table is included,identifiers with the prefixes, suffixes or complete names shownare reserved for any use by the implementation.<hr size=2 noshade><p><table  bordercolor=#000000 border=1 align=center><tr valign=top><tr valign=top><th align=center><b>Header</b><th align=center><b>Prefix</b><th align=center><b>Suffix</b><th align=center><b>Complete Name</b><tr valign=top><td align=left><b>&lt;aio.h&gt;</b><td align=left>aio_, lio_, AIO_, LIO_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;dirent.h&gt;</b><td align=left>d_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;errno.h&gt;</b><td align=left>E<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;fcntl.h&gt;</b><td align=left>l_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;glob.h&gt;</b><td align=left>gl_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;grp.h&gt;</b><td align=left>gr_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;limits.h&gt;</b><td align=left>&nbsp;<td align=left>_MAX<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;locale.h&gt;</b><td align=left>LC_[A-Z]<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;mqueue.h&gt;</b><td align=left>mq_, MQ_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;ndbm.h&gt;</b><td align=left>dbm_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;poll.h&gt;</b><td align=left>pd_, ph_, ps_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;pthread.h&gt;</b><td align=left>pthread_, PTHREAD_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;pwd.h&gt;</b><td align=left>pw_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;regex.h&gt;</b><td align=left>re_, rm_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sched.h&gt;</b><td align=left>sched_, SCHED_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;semaphore.h&gt;</b><td align=left>sem_, SEM_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;signal.h&gt;</b><td align=left>sa_, SIG[A-Z], SIG_[A-Z], ss_, sv_, si_, SI_, sigev_, SIGEV_, sival_, uc_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;stropts.h&gt;</b><td align=left>bi_, ic_, l_, sl_, str_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/ipc.h&gt;</b><td align=left>ipc_<td align=left>&nbsp;<td align=left>key, pad, seq<tr valign=top><td align=left><b>&lt;sys/mman.h&gt;</b><td align=left>shm_, MAP_, MCL_, MS_, PROT_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/msg.h&gt;</b><td align=left>msg<td align=left>&nbsp;<td align=left>msg<tr valign=top><td align=left><b>&lt;sys/resource.h&gt;</b><td align=left>rlim_, ru_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/sem.h&gt;</b><td align=left>sem<td align=left>&nbsp;<td align=left>sem<tr valign=top><td align=left><b>&lt;sys/shm.h&gt;</b><td align=left>shm<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/stat.h&gt;</b><td align=left>st_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/statvfs.h&gt;</b><td align=left>f_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/time.h&gt;</b><td align=left>fds_, it_, tv_, FD_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/times.h&gt;</b><td align=left>tms_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/uio.h&gt;</b><td align=left>iov_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/utsname.h&gt;</b><td align=left>uts_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;sys/wait.h&gt;</b><td align=left>si_, W[A-Z], P_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;termios.h&gt;</b><td align=left>c_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;time.h&gt;</b><td align=left>tm_, clock_, timer_, it_, tv_, CLOCK_, TIMER_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;ucontext.h&gt;</b><td align=left>uc_, ss_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;ulimit.h&gt;</b><td align=left>UL_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;utime.h&gt;</b><td align=left>utim_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;utmpx.h&gt;</b><td align=left>ut_<td align=left>_LVL, _TIME, _PROCESS<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;wordexp.h&gt;</b><td align=left>we_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>ANY header</b><td align=left>&nbsp;<td align=left>_t<td align=left>&nbsp;</table><dl><dt><b>Note:</b><dd>The notation [A-Z] indicates any upper-case letter in the portablecharacter set.The notation [a-z] indicates any lower-case letter in the portablecharacter set.Commas and spaces in the lists of prefixes and complete names in the abovetable are not part of any prefix or complete name.</dl>If any header in the following table is included, macros with the prefixesshown may be defined.  After the last inclusion of a given header, anapplication may use identifiers with the corresponding prefixes for its ownpurpose, provided their use is preceded by an<b>#undef</b>of the corresponding macro.<p><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Header</b><th colspan=5 align=center><b>Prefix</b><tr valign=top><td align=left><b>&lt;dlfcn.h&gt;</b><td align=left>RTLD_<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;fcntl.h&gt;</b><td align=left>F_<td align=left>O_<td align=left>S_<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;fmtmsg.h&gt;</b><td align=left>MM_<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;fnmatch.h&gt;</b><td align=left>FNM_<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;ftw.h&gt;</b><td align=left>FTW<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;glob.h&gt;</b><td align=left>GLOB_<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;ndbm.h&gt;</b><td align=left>DBM_<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;nl_types.h&gt;</b><td align=left>NL_<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;poll.h&gt;</b><td align=left>POLL<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;regex.h&gt;</b><td align=left>REG_<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<td align=left>&nbsp;<tr valign=top><td align=left><b>&lt;signal.h&gt;</b><td align=left>SA_<td align=left>SIG_[0-9a-z_]<td align=left>&nbsp;

⌨️ 快捷键说明

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