I've just been documenting the new feature test macro requirements for truncate() and ftruncate() in glibc 2.12, and it appears that the FTMs for ftruncate() are incorrect. Some background. In POSIX, these functions are marked as follows: POSIX.1-2001/SUSv3 ftruncate() no markings truncate() marked XSI POSIX.1-2008/SUSv4 ftruncate() no markings truncate() no markings Here's the history of feature test macro requirements for these two functions as defined in <unistd.h>: truncate(): Since glibc 2.12 _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE >= 200809L Before glibc 2.12: _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED ftruncate(): Since glibc 2.12: _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE >= 200809L Between glibc 2.3.5 and 2.11 _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE >= 200112L Before glibc 2.3.5: _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED From the above, ftruncate() is no longer exposed in glibc 2.12 if _POSIX_C_SOURCE >= 200112. This seems pretty clearly incorrect. I belive the FTMs governing the declaration should have remained as they were pre 2.12: #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
Fixed in git.