The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 The Name Space (XNS)

When _XOPEN_SOURCE is defined, each header defines or declares some identifiers, potentially conflicting with identifiers used by the application. The set of identifiers visible to the application consists of precisely those identifiers from the header pages of the included headers, as well as additional identifiers reserved for the implementation. In addition, some headers may make visible identifiers from other headers as indicated on the relevant header pages.

The identifiers reserved for use by the implementation are described below.

  1. Each identifier with external linkage described in the header section is reserved for use as an identifier with external linkage if the header is included.

  2. Each macro name described in the header section is reserved for any use if the header is included.

  3. Each identifier with file scope described in the header section is reserved for use as an identifier with file scope in the same name space if the header is included.

If any header in the following table is included, identifiers with the following prefixes or suffixes shown are reserved for any use by the implementation.

Header Prefix Suffix
<arpa/inet.h> in_, inet_  
<netdb.h> h_, n_, p_, s_  
<netinet/in.h> in_, ip_, s_, sin_  
<sys/socket.h> sa_, if_, ifc_, ifru_, infu_, ifra_, msg_, cmsg_, l_  
<sys/un.h> sun_  
<xti.h> l_, t_, T_  
ANY header  _t

If any header in the following table is included, macros with the prefixes shown may be defined. After the last inclusion of a given header, an application may use identifiers with the corresponding prefixes for its own purpose, provided their use is preceded by an #undef of the corresponding macro.

Header Prefix
<netinet/in.h> IMPLINK_, IN_, INADDR_, IP_, IPPORT_, IPPROTO_, SOCK_
<sys/socket.h> AF_, CMSG_, MSG_, PF_, SCM_, SHUT_, SO
<xti.h> OPT_, T_, XTI_

The following identifiers are reserved regardless of the inclusion of headers:

  1. All identifiers that begin with an underscore and either an upper-case letter or another underscore are always reserved for any use by the implementation.

  2. All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary identifier and tag name spaces.

  3. All identifiers in the table below are reserved for use as identifiers with external linkage.

    XTI:
    t_accept t_alloc t_bind t_close t_connect t_errno t_error t_free   t_getinfo t_getprotaddr t_getstate t_listen t_look t_open t_optmgmt   t_rcv t_rcvconnect t_rcvdis t_rcvrel t_rcvreldata t_rcvudata t_rcvuderr   t_rcvv t_rcvvudata t_snd t_snd t_snddis t_sndrel t_sndreldata   t_sndudata t_sndv t_sndvudata t_strerror t_sync t_sysconf t_unbind
    Sockets:
    accept bind connect getpeername   getsockname getsockopt listen recv   recvfrom recvmsg send   sendmsg sendto setsockopt   shutdown socket socketpair
    IP Address Resolution:
    endhostent endnetent endprotoent endservent gethostbyaddr gethostbyname gethostent gethostname getnetbyaddr getnetbyname getnetent getprotobyname getprotobynumber getprotoent getservbyname getservbyport getservent h_errno htonl htons inet_addr inet_lnaof inet_makeaddr inet_netof inet_network inet_ntoa ntohl ntohs sethostent setnetent setprotoent setservent

All the identifiers defined in this document that have external linkage are always reserved for use as identifiers with external linkage.

No other identifiers are reserved.

Applications must not declare or define identifiers with the same name as an identifier reserved in the same context. Since macro names are replaced whenever found, independent of scope and name space, macro names matching any of the reserved identifier names must not be defined if any associated header is included.

Headers may be included in any order, and each may be included more than once in a given scope, with no difference in effect from that of being included only once.

If used, a header must be included outside of any external declaration or definition, and it must be first included before the first reference to any type or macro it defines, or to any function or object it declares. However, if an identifier is declared or defined in more than one header, the second and subsequent associated headers may be included after the initial reference to the identifier. Prior to the inclusion of a header, the program must not define any macros with names lexically identical to symbols defined by that header.


UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]