14 #define __NEED_clock_t
16 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
17 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
18 || defined(_BSD_SOURCE)
19 #define __NEED_struct_timespec
20 #define __NEED_clockid_t
21 #define __NEED_timer_t
23 #define __NEED_locale_t
26 #include <bits/alltypes.h>
28 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
29 #define __tm_gmtoff tm_gmtoff
30 #define __tm_zone tm_zone
45 const char *__tm_zone;
49 time_t time (time_t *);
50 double difftime (time_t, time_t);
51 time_t mktime (struct tm *);
52 size_t strftime (char *__restrict, size_t, const char *__restrict, const struct tm *__restrict);
53 struct tm *gmtime (const time_t *);
54 struct tm *localtime (const time_t *);
55 char *asctime (const struct tm *);
56 char *ctime (const time_t *);
58 #define CLOCKS_PER_SEC 1000000L
61 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
62 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
63 || defined(_BSD_SOURCE)
65 size_t strftime_l (char * __restrict, size_t, const char * __restrict, const struct tm * __restrict, locale_t);
67 struct tm *gmtime_r (const time_t *__restrict, struct tm *__restrict);
68 struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict);
69 char *asctime_r (const struct tm *__restrict, char *__restrict);
70 char *ctime_r (const time_t *, char *);
76 struct timespec it_interval;
77 struct timespec it_value;
80 #define CLOCK_REALTIME 0
81 #define CLOCK_MONOTONIC 1
82 #define CLOCK_PROCESS_CPUTIME_ID 2
83 #define CLOCK_THREAD_CPUTIME_ID 3
84 #define CLOCK_MONOTONIC_RAW 4
85 #define CLOCK_REALTIME_COURSE 5
86 #define CLOCK_MONOTONIC_COURSE 6
87 #define CLOCK_BOOTTIME 7
88 #define CLOCK_REALTIME_ALARM 8
89 #define CLOCK_BOOTTIME_ALARM 9
90 #define CLOCK_SGI_CYCLE 10
93 #define TIMER_ABSTIME 1
95 int nanosleep (const struct timespec *, struct timespec *);
96 int clock_getres (clockid_t, struct timespec *);
97 int clock_gettime (clockid_t, struct timespec *);
98 int clock_settime (clockid_t, const struct timespec *);
99 int clock_nanosleep (clockid_t, int, const struct timespec *, struct timespec *);
100 int clock_getcpuclockid (pid_t, clockid_t *);
103 int timer_create (clockid_t, struct sigevent *__restrict, timer_t *__restrict);
104 int timer_delete (timer_t);
105 int timer_settime (timer_t, int, const struct itimerspec *__restrict, struct itimerspec *__restrict);
106 int timer_gettime (timer_t, struct itimerspec *);
107 int timer_getoverrun (timer_t);
112 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
113 char *strptime (const char *__restrict, const char *__restrict, struct tm *__restrict);
115 extern long timezone;
116 extern char *tzname[2];
117 extern int getdate_err;
118 struct tm *getdate (const char *);
122 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
124 time_t timegm(struct tm *);