2 #if defined __need_time_t || defined __need_clock_t || defined __need_timespec
3 # include <time/time.h>
5 # include <time/time.h>
10 extern __typeof (strftime_l
) __strftime_l
;
11 libc_hidden_proto (__strftime_l
)
12 extern __typeof (strptime_l
) __strptime_l
;
14 libc_hidden_proto (time
)
15 libc_hidden_proto (asctime
)
16 libc_hidden_proto (mktime
)
17 libc_hidden_proto (timelocal
)
18 libc_hidden_proto (localtime
)
19 libc_hidden_proto (strftime
)
20 libc_hidden_proto (strptime
)
22 librt_hidden_proto (clock_gettime
)
24 /* Now define the internal interfaces. */
27 /* Defined in mktime.c. */
28 extern const unsigned short int __mon_yday
[2][13] attribute_hidden
;
30 /* Defined in localtime.c. */
31 extern struct tm _tmbuf attribute_hidden
;
33 /* Defined in tzset.c. */
34 extern char *__tzstring (const char *string
);
36 /* Defined in tzset.c. */
37 extern size_t __tzname_cur_max attribute_hidden
;
40 extern int __use_tzfile attribute_hidden
;
42 extern void __tzfile_read (const char *file
, size_t extra
,
44 extern void __tzfile_compute (time_t timer
, int use_localtime
,
45 long int *leap_correct
, int *leap_hit
,
47 extern void __tzfile_default (const char *std
, const char *dst
,
48 long int stdoff
, long int dstoff
);
50 /* Subroutine of `mktime'. Return the `time_t' representation of TP and
51 normalize TP, given that a `struct tm *' maps to a `time_t' as performed
52 by FUNC. Keep track of next guess for time_t offset in *OFFSET. */
53 extern time_t __mktime_internal (struct tm
*__tp
,
54 struct tm
*(*__func
) (const time_t *,
57 extern struct tm
*__localtime_r (__const
time_t *__timer
,
58 struct tm
*__tp
) attribute_hidden
;
60 extern struct tm
*__gmtime_r (__const
time_t *__restrict __timer
,
61 struct tm
*__restrict __tp
);
62 libc_hidden_proto (__gmtime_r
)
64 /* Compute the `struct tm' representation of *T,
65 offset OFFSET seconds east of UTC,
66 and store year, yday, mon, mday, wday, hour, min, sec into *TP.
67 Return nonzero if successful. */
68 extern int __offtime (__const
time_t *__timer
,
72 extern char *__asctime_r (__const
struct tm
*__tp
, char *__buf
);
73 extern void __tzset (void);
75 /* Prototype for the internal function to get information based on TZ. */
76 extern struct tm
*__tz_convert (const time_t *timer
, int use_localtime
, struct tm
*tp
);
78 /* Return the maximum length of a timezone name.
79 This is what `sysconf (_SC_TZNAME_MAX)' does. */
80 extern long int __tzname_max (void);
82 extern int __nanosleep (__const
struct timespec
*__requested_time
,
83 struct timespec
*__remaining
);
84 libc_hidden_proto (__nanosleep
)
85 extern int __nanosleep_nocancel (__const
struct timespec
*__requested_time
,
86 struct timespec
*__remaining
)
88 extern int __getdate_r (__const
char *__string
, struct tm
*__resbufp
);
91 /* Determine CLK_TCK value. */
92 extern int __getclktck (void);
95 /* strptime support. */
96 /* Status of lookup: do we use the locale data or the raw data? */
98 /* C++ cannot deal with using 'not'. */
99 enum ptime_locale_status
{ not, loc
, raw
};
101 extern char * __strptime_internal (const char *rp
, const char *fmt
,
103 enum ptime_locale_status
*decided
,
104 int era_cnt
, __locale_t locparam
)
108 extern double __difftime (time_t time1
, time_t time0
);
111 /* Use in the clock_* functions. Size of the field representing the
114 # define CLOCK_IDFIELD_SIZE 3