localtime_r.c 314 B

12345678910111213141516171819202122
  1. #include <time.h>
  2. #include <sys/time.h>
  3. extern void __tm_conv();
  4. struct tm *localtime_r(timep, tp)
  5. __const time_t *timep;
  6. struct tm *tp;
  7. {
  8. struct timezone tz;
  9. time_t offt;
  10. gettimeofday((void *) 0, &tz);
  11. offt = -tz.tz_minuteswest * 60L;
  12. /* tmb.tm_isdst = ? */
  13. __tm_conv(tp, timep, offt);
  14. return tp;
  15. }