gmtime_r.c 300 B

12345678910111213141516
  1. #include "time_impl.h"
  2. #include <errno.h>
  3. struct tm *__gmtime_r(const time_t *restrict t, struct tm *restrict tm)
  4. {
  5. if (__secs_to_tm(*t, tm) < 0) {
  6. errno = EOVERFLOW;
  7. return 0;
  8. }
  9. tm->tm_isdst = 0;
  10. tm->__tm_gmtoff = 0;
  11. tm->__tm_zone = __utc;
  12. return tm;
  13. }
  14. weak_alias(__gmtime_r, gmtime_r);