#ifndef _TIME_H_
#define _TIME_H_
#include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h>
#include <sys/_clock_id.h>
#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
#define CLK_TCK 128
#endif
#define CLOCKS_PER_SEC 128
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
#endif
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
#if __POSIX_VISIBLE >= 199309
#ifndef _CLOCKID_T_DECLARED
typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
#ifndef _TIMER_T_DECLARED
typedef __timer_t timer_t;
#define _TIMER_T_DECLARED
#endif
#include <sys/timespec.h>
#endif
#if __POSIX_VISIBLE >= 200112
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
#endif
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long tm_gmtoff;
char *tm_zone;
};
#if __POSIX_VISIBLE
extern char *tzname[];
#endif
__BEGIN_DECLS
char *asctime(const struct tm *);
clock_t clock(void);
char *ctime(const time_t *);
#ifndef _STANDALONE
double difftime(time_t, time_t);
#endif
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
size_t strftime(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict);
time_t time(time_t *);
#if __POSIX_VISIBLE >= 200112
struct sigevent;
int timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict);
int timer_delete(timer_t);
int timer_gettime(timer_t, struct itimerspec *);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const struct itimerspec *__restrict,
struct itimerspec *__restrict);
#endif
#if __POSIX_VISIBLE
void tzset(void);
#endif
#if __POSIX_VISIBLE >= 199309
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
int nanosleep(const struct timespec *, struct timespec *);
#endif
#if __POSIX_VISIBLE >= 200112
int clock_getcpuclockid(pid_t, clockid_t *);
int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *);
#endif
#if __POSIX_VISIBLE >= 199506
char *asctime_r(const struct tm *, char *);
char *ctime_r(const time_t *, char *);
#endif
#if __POSIX_VISIBLE >= 199506 || __ISO_C_VISIBLE >= 2023
struct tm *gmtime_r(const time_t *, struct tm *);
struct tm *localtime_r(const time_t *, struct tm *);
#endif
#if __XSI_VISIBLE
char *strptime(const char * __restrict, const char * __restrict,
struct tm * __restrict);
extern long timezone;
extern int daylight;
#endif
#if __BSD_VISIBLE
time_t timelocal(struct tm * const);
int timer_oshandle_np(timer_t timerid);
time_t time2posix(time_t t);
time_t posix2time(time_t t);
struct tm *offtime(const time_t *, long);
struct tm *offtime_r(const time_t *__restrict, long, struct tm *__restrict);
#endif
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#include <xlocale/_time.h>
#endif
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2011 || \
(defined(__cplusplus) && __cplusplus >= 201703)
#include <sys/_timespec.h>
#define TIME_UTC 1
int timespec_get(struct timespec *ts, int base);
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023
#define TIME_MONOTONIC 2
int timespec_getres(struct timespec *, int);
time_t timegm(struct tm * const);
#endif
#endif
__END_DECLS
#endif