localtime_r.c 305 B

12345678910111213141516171819202122
  1. #include <time.h>
  2. extern void __tm_conv();
  3. struct tm *
  4. 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. }