13 #define NULL ((void*)0)
19 #define __NEED_clock_t
20 #define __NEED_struct_timespec
22 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
23 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
24 || defined(_BSD_SOURCE)
25 #define __NEED_clockid_t
26 #define __NEED_timer_t
28 #define __NEED_locale_t
31 #include <bits/alltypes.h>
33 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
34 #define __tm_gmtoff tm_gmtoff
35 #define __tm_zone tm_zone
50 const char *__tm_zone
;
54 time_t time (time_t *);
55 double difftime (time_t, time_t);
56 time_t mktime (struct tm
*);
57 size_t strftime (char *__restrict
, size_t, const char *__restrict
, const struct tm
*__restrict
);
58 struct tm
*gmtime (const time_t *);
59 struct tm
*localtime (const time_t *);
60 char *asctime (const struct tm
*);
61 char *ctime (const time_t *);
62 int timespec_get(struct timespec
*, int);
64 #define CLOCKS_PER_SEC 1000000L
68 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
69 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
70 || defined(_BSD_SOURCE)
72 size_t strftime_l (char * __restrict
, size_t, const char * __restrict
, const struct tm
* __restrict
, locale_t
);
74 struct tm
*gmtime_r (const time_t *__restrict
, struct tm
*__restrict
);
75 struct tm
*localtime_r (const time_t *__restrict
, struct tm
*__restrict
);
76 char *asctime_r (const struct tm
*__restrict
, char *__restrict
);
77 char *ctime_r (const time_t *, char *);
83 struct timespec it_interval
;
84 struct timespec it_value
;
87 #define CLOCK_REALTIME 0
88 #define CLOCK_MONOTONIC 1
89 #define CLOCK_PROCESS_CPUTIME_ID 2
90 #define CLOCK_THREAD_CPUTIME_ID 3
91 #define CLOCK_MONOTONIC_RAW 4
92 #define CLOCK_REALTIME_COARSE 5
93 #define CLOCK_MONOTONIC_COARSE 6
94 #define CLOCK_BOOTTIME 7
95 #define CLOCK_REALTIME_ALARM 8
96 #define CLOCK_BOOTTIME_ALARM 9
97 #define CLOCK_SGI_CYCLE 10
100 #define TIMER_ABSTIME 1
102 int nanosleep (const struct timespec
*, struct timespec
*);
103 int clock_getres (clockid_t
, struct timespec
*);
104 int clock_gettime (clockid_t
, struct timespec
*);
105 int clock_settime (clockid_t
, const struct timespec
*);
106 int clock_nanosleep (clockid_t
, int, const struct timespec
*, struct timespec
*);
107 int clock_getcpuclockid (pid_t
, clockid_t
*);
110 int timer_create (clockid_t
, struct sigevent
*__restrict
, timer_t
*__restrict
);
111 int timer_delete (timer_t
);
112 int timer_settime (timer_t
, int, const struct itimerspec
*__restrict
, struct itimerspec
*__restrict
);
113 int timer_gettime (timer_t
, struct itimerspec
*);
114 int timer_getoverrun (timer_t
);
119 #if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
120 char *strptime (const char *__restrict
, const char *__restrict
, struct tm
*__restrict
);
122 extern long timezone
;
123 extern char *tzname
[2];
124 extern int getdate_err
;
125 struct tm
*getdate (const char *);
129 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
130 int stime(const time_t *);
131 time_t timegm(struct tm
*);