2 #if defined __need_time_t || defined __need_clock_t || defined __need_timespec
3 # include <time/time.h>
5 # include <time/time.h>
7 /* Now define the internal interfaces. */
10 /* Defined in mktime.c. */
11 extern const unsigned short int __mon_yday
[2][13];
13 /* Defined in localtime.c. */
14 extern struct tm _tmbuf
;
16 /* Defined in tzset.c. */
17 extern char *__tzstring (const char *string
);
19 /* Defined in tzset.c. */
20 extern size_t __tzname_cur_max
;
23 extern int __use_tzfile
;
25 extern void __tzfile_read (const char *file
, size_t extra
,
27 extern int __tzfile_compute (time_t timer
, int use_localtime
,
28 long int *leap_correct
, int *leap_hit
,
30 extern void __tzfile_default (const char *std
, const char *dst
,
31 long int stdoff
, long int dstoff
);
33 /* Subroutine of `mktime'. Return the `time_t' representation of TP and
34 normalize TP, given that a `struct tm *' maps to a `time_t' as performed
35 by FUNC. Keep track of next guess for time_t offset in *OFFSET. */
36 extern time_t __mktime_internal (struct tm
*__tp
,
37 struct tm
*(*__func
) (const time_t *,
40 extern struct tm
*__localtime_r (__const
time_t *__timer
,
43 extern struct tm
*__gmtime_r (__const
time_t *__restrict __timer
,
44 struct tm
*__restrict __tp
);
46 /* Compute the `struct tm' representation of *T,
47 offset OFFSET seconds east of UTC,
48 and store year, yday, mon, mday, wday, hour, min, sec into *TP.
49 Return nonzero if successful. */
50 extern int __offtime (__const
time_t *__timer
,
54 extern char *__asctime_r (__const
struct tm
*__tp
, char *__buf
);
55 extern void __tzset (void);
57 /* Prototype for the internal function to get information based on TZ. */
58 extern struct tm
*__tz_convert (const time_t *timer
, int use_localtime
, struct tm
*tp
);
60 /* Return the maximum length of a timezone name.
61 This is what `sysconf (_SC_TZNAME_MAX)' does. */
62 extern long int __tzname_max (void);
64 extern int __nanosleep (__const
struct timespec
*__requested_time
,
65 struct timespec
*__remaining
);
66 extern int __getdate_r (__const
char *__string
, struct tm
*__resbufp
);
69 /* Determine CLK_TCK value. */
70 extern int __getclktck (void);