Collectives on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more
It allows you to use functions that are not part of the standard C library but are part of the POSIX.1 (IEEE Standard 1003.1) standard. Using the macros described in
feature_test_macros
allows you to control the definitions exposed
by the system header files.
As far as I know
_POSIX_SOURCE
is obsolete and you should use
_POSIX_C_SOURCE
instead.
For example, if you want to use
strndup
, you have to use
#define _POSIX_C_SOURCE 200809L
See also
1.3.4 Feature Test Macros
5.12 Posix Variants
man 7 feature_test_macros
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.