timespec_get.c 282 B

12345678910
  1. #include <time.h>
  2. /* There is no other implemented value than TIME_UTC; all other values
  3. * are considered erroneous. */
  4. int timespec_get(struct timespec * ts, int base)
  5. {
  6. if (base != TIME_UTC) return 0;
  7. int ret = clock_gettime(CLOCK_REALTIME, ts);
  8. return ret < 0 ? 0 : base;
  9. }