localtime_r.c 292 B

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