IPB
>  Man Pages > Linux > openSUSE 10.2 > Section 7 > feature_test_macros man page

feature_test_macros man page

Section 7 - openSUSE 10.2 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!


FEATURE_TEST_MACROS(7)     Linux Programmer's Manual    FEATURE_TEST_MACROS(7)



NAME
       feature_test_macros - feature test macros

SYNOPSIS
       #include <features.h>

DESCRIPTION
       Feature  test  macros  allow  the programmer to control the definitions
       that are exposed by system header files when  a  program  is  compiled.
       This  can  be  useful for creating portable applications, by preventing
       non-standard definitions from being exposed.  Other macros can be  used
       to  expose  non-standard  definitions  that are not exposed by default.
       The precise effects of each of the feature test macros described  below
       can be ascertained by inspecting the <features.h> header file.

       In  order  to be effective, a feature test macro must be defined before
       including any header files.  This can either be done in the compilation
       command  (cc  -DMACRO=value) or by defining the macro within the source
       code before including any headers.

       Linux/glibc understands the following feature test macros:

       _POSIX_C_SOURCE
              Defining this macro with the value  1  causes  header  files  to
              expose  definitions conforming to POSIX.1-1990 and ISO C (1990).
              Defining with the value 199309 or greater  additionally  exposes
              definitions  for POSIX.1b (real-time extensions).  Defining with
              the value 199506 or greater additionally exposes definitions for
              POSIX.1c (threads).  Defining with the value 200112 exposes def-
              initions corresponding to the  POSIX.1-2001  base  specification
              (excluding the XSI extension).

       _POSIX_SOURCE
              Defining  this  obsolete  macro  with any value is equivalent to
              defining _POSIX_C_SOURCE with the value 1.

       _XOPEN_SOURCE
              Defining this macro with any value causes header files to expose
              definitions  conforming to POSIX.1, POSIX.2, and XPG4.  Defining
              with the value 500 or greater additionally  exposes  definitions
              for  SUSv2  (UNIX  98).   Defining with the value 600 or greater
              additionally exposes definitions for SUSv3 (UNIX 03;  i.e.,  the
              POSIX.1-2001 base specification plus the XSI extension) and C 99
              definitions.

       _XOPEN_SOURCE_EXTENDED
              If this macro is defined with the value 1, and the _XOPEN_SOURCE
              is  defined, then expose definitions corresponding to the XPG4v2
              UNIX extensions.

       _ISOC99_SOURCE
              Exposes C 99 extensions to ISO C (1990).

       _LARGEFILE64_SOURCE
              Expose definitions for the alternative API specified by the  LFS
              (Large  File  Summit)  as  a "transitional extension" the Single
              UNIX     Specification.       (See      http://ftp.sas.com/stan-
              dards/large.file/.)

       _FILE_OFFSET_BITS
              Defining  this  macro  with  the value 64 automatically converts
              references to 32-bit functions and data types  related  to  file
              I/O  and  file system operations into references to their 64-bit
              counterparts.  This is useful for performing I/O on large  files
              (> 2 Gigabytes) on 32-bit systems.

       _BSD_SOURCE
              Defining  this macro with any value cause header files to expose
              BSD-derived definitions.  Defining this macro  also  causes  BSD
              definitions  to  be preferred in some situations where standards
              conflict.

       _SVID_SOURCE
              Defining this macro with any value cause header files to  expose
              System V-derived definitions.  (SVID == System V Interface Defi-
              nition; see standards(7).)

       _GNU_SOURCE
              Defining this macro (with any value) is equivalent  to  defining
              _BSD_SOURCE,  _SVID_SOURCE,  _LARGEFILE64_SOURCE, _ISOC99_SOURCE
              _POSIX_C_SOURCE with the value 1999506, and  _XOPEN_SOURCE  with
              the value 600.  In addition, various GNU-specific extensions are
              also exposed.

       When gcc(1) is invoked, the following macros are  defined  by  default:
       _BSD_SOURCE,  _SVID_SOURCE,  _POSIX_SOURCE,  and POSIX_C_SOURCE=199506.
       If individual macros are defined, then other macros are disabled unless
       they are also explicitly defined.  (Exception: if POSIX_C_SOURCE is not
       otherwise defined, then it is always defined  with  the  value  199506,
       unless  the compiler is invoked in one of its standard modes, e.g., the
       -std=c99 flag.)  Multiple macros can be defined; the results are  addi-
       tive.

CONFORMING TO
       POSIX.1  specifies  _POSIX_C_SOURCE,  _POSIX_SOURCE, and _XOPEN_SOURCE.
       _XOPEN_SOURCE_EXTENDED was specified by XPG4v2 (aka SUSv1).  _FILE_OFF-
       SET_BITS  is  not  specified  by  any standard, but is employed on some
       other implementations.  _BSD_SOURCE, _SVID_SOURCE, and _GNU_SOURCE  are
       Linux (glibc) specific.

NOTES
       <features.h> is a Linux/glibc specific header file.  Other systems have
       an analogous file, but typically with a different  name.   This  header
       file is automatically included by other header files as required: it is
       not necessary to explicitly include it in order to employ feature  test
       macros.



Linux                             2006-04-26            FEATURE_TEST_MACROS(7)


Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Sat Sep 8 16:40:21 GMT 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

svn man page (6164 hits)
(FreeBSD 6.2)

sqlite3 man page (5598 hits)
(openSUSE 10.2)

adv_cap_autoneg man page (5045 hits)
(Solaris 10 11_06)

CPAN man page (4791 hits)
(Suse Linux 10.1)

ssh man page (4439 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (3525 hits)
(Solaris 10 11_06)

signal man page (3395 hits)
(Suse Linux 10.1)

netcat man page (3383 hits)
(Suse Linux 10.1)

pprosetup man page (2889 hits)
(Solaris 10 11_06)

startproc man page (2739 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Summer Activities :: Touch Sensor IC :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum