Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #include <time.h> |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 2 | #include "syscall.h" |
| 3 | |
Rich Felker | e3eb493 | 2011-07-23 23:45:33 -0400 | [diff] [blame] | 4 | int __clock_gettime(clockid_t, struct timespec *); |
| 5 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 6 | time_t time(time_t *t) |
| 7 | { |
Rich Felker | e3eb493 | 2011-07-23 23:45:33 -0400 | [diff] [blame] | 8 | struct timespec ts; |
| 9 | __clock_gettime(CLOCK_REALTIME, &ts); |
| 10 | if (t) *t = ts.tv_sec; |
| 11 | return ts.tv_sec; |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 12 | } |