12 #define NULL ((void*)0)
18 #define __NEED_clock_t
20 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
21 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
22 || defined(_BSD_SOURCE)
23 #define __NEED_struct_timespec
24 #define __NEED_clockid_t
25 #define __NEED_timer_t
27 #define __NEED_locale_t
30 #include <bits/alltypes.h>
44 const char *__tm_zone;
48 time_t time (time_t *);
49 double difftime (time_t, time_t);
50 time_t mktime (struct tm *);
51 size_t strftime (char *, size_t, const char *, const struct tm *);
52 struct tm *gmtime (const time_t *);
53 struct tm *localtime (const time_t *);
54 char *asctime (const struct tm *);
55 char *ctime (const time_t *);
57 #define CLOCKS_PER_SEC 1000000UL
60 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
61 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
62 || defined(_BSD_SOURCE)
64 size_t strftime_l (char *, size_t, const char *, const struct tm *, locale_t);
66 struct tm *gmtime_r (const time_t *, struct tm *);
67 struct tm *localtime_r (const time_t *, struct tm *);
68 char *asctime_r (const struct tm *, char *);
69 char *ctime_r (const time_t *, char *);
75 struct timespec it_interval;
76 struct timespec it_value;
79 #define CLOCK_REALTIME 0
80 #define CLOCK_MONOTONIC 1
81 #define CLOCK_PROCESS_CPUTIME_ID 2
82 #define CLOCK_THREAD_CPUTIME_ID 3
84 #define TIMER_ABSTIME 1
86 int nanosleep (const struct timespec *, struct timespec *);
87 int clock_getres (clockid_t, struct timespec *);
88 int clock_gettime (clockid_t, struct timespec *);
89 int clock_settime (clockid_t, const struct timespec *);
90 int clock_nanosleep (clockid_t, int, const struct timespec *, struct timespec *);
91 int clock_getcpuclockid (pid_t, clockid_t *);
94 int timer_create (clockid_t, struct sigevent *, timer_t *);
95 int timer_delete (timer_t);
96 int timer_settime (timer_t, int, const struct itimerspec *, struct itimerspec *);
97 int timer_gettime (timer_t, struct itimerspec *);
98 int timer_getoverrun (timer_t);
103 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
104 char *strptime (const char *, const char *, struct tm *);
106 extern long timezone;
107 extern char *tzname[2];
108 extern int getdate_err;
109 struct tm *getdate (const char *);
113 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
115 time_t timegm(struct tm *);