Linuxプログラミング#define_XOPEN_SOURCEの役割


[  ]
#define _XOPEN_SOURCE
         
                   

[  ]
Glibc                :
1.ISO C: C      . 
2.POSIX:       ISO/IEC 9945 (aka IEEE 1003)   . 
3.Berkeley Unix: BSD   SunOS. 
4.SVID: V       . 
5.XPG: The X/Open Portability Guide.

   ,                。      POSIX,    _POSIX_SOURCE。     _BSD_SOURCE、_SVID_SOURCE、_XOPEN_SOURCE。
    :
#define _XOPEN_SOURCE
        5. The X/Open Portability Guide    。

[    ]
              :
    1) cc     , :cc -D _POSIX_SOURCE file.c
    2)           :#define _POSIX_SOURCE 1

[_XOPEN_SOURCE   ?]
          ,        :
Macro: _XOPEN_SOURCE 
If you define this macro, functionality described in the X/Open Portability Guide is included. This is a superset of the POSIX.1 and POSIX.2 functionality and in fact _POSIX_SOURCE and _POSIX_C_SOURCE are automatically defined. 
As the unification of all Unices, functionality only available in BSD and SVID is also included. 
If the macro _XOPEN_SOURCE_EXTENDED is also defined, even more functionality is available. The exa functions will make all functions available which are necessary for the X/Open Unix brand.