ctime_r.c 348 B

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