It turned out that extended timer functions, such as timer_settime , were indeed part of the real-time POSIX extension, as Ken Thomases suggested. Referring to the documentation change history for this function:
Problem 6
The timer_getoverrun (), timer_gettime (), and timer_settime () functions are marked as part of the Timers parameter.
Problem 7
The functions timer_getoverrun (), timer_gettime () and timer_settime () are moved from the Timers option to the base.
The latest POSIX standard, POSIX.1-2008, Release 7, was released most recently, in 2013. My computer is running OS X 10.9, which was also released at the end of 2013, so I believe that it does not meet the latest standard. However, wikipedia says the latest version of OS X v10.10 “Yosemite,” released at the end of 2014, is fully compatible with POSIX.
In the end, however, I still don’t understand how to write portable code when certain functions are silently marked as “extensions” by standard, and man pages do not mention this significant fact.
source share