Sidebar – the feature test macros

A quick digression: feature test macros are a glibc feature; they allow a developer to specify, at compile time, the exact feature set by defining these macros in the source. The manual (man) pages always specify (as required), the feature test macros required to be present to support a certain API or feature.

With regard to these feature test macros, on both the Ubuntu (17.10) and Fedora (27) Linux distributions, we have tested the source code of this book upon, the value of _POSIX_C_SOURCE is 200809L. The macro is defined in the header file <features.h>, which is itself included in the header <unistd.h>.

A simple test program to print a few feature test macros is provided within the book's GitHub source ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.