1570af302Sopenharmony_ci#include <time.h> 2570af302Sopenharmony_ci 3570af302Sopenharmony_ci/* There is no other implemented value than TIME_UTC; all other values 4570af302Sopenharmony_ci * are considered erroneous. */ 5570af302Sopenharmony_ciint timespec_get(struct timespec * ts, int base) 6570af302Sopenharmony_ci{ 7570af302Sopenharmony_ci if (base != TIME_UTC) return 0; 8570af302Sopenharmony_ci int ret = __clock_gettime(CLOCK_REALTIME, ts); 9570af302Sopenharmony_ci return ret < 0 ? 0 : base; 10570af302Sopenharmony_ci} 11