#include extern int __clock_getres(clockid_t clk, struct timespec *ts); /* There is no other implemented value than TIME_UTC; all other values * are considered erroneous. */ int timespec_getres(struct timespec * ts, int base) { if (base != TIME_UTC) return 0; int ret = __clock_getres(CLOCK_REALTIME, ts); return ret < 0 ? 0 : base; }