meta: move photon/libc to root
This commit is contained in:
46
libc/include/time.h
Normal file
46
libc/include/time.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef TIME_H_
|
||||
#define TIME_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/_time.h>
|
||||
|
||||
#define CLOCKS_PER_SEC __SYS_CLOCKS_PER_SEC
|
||||
#define CLOCK_REALTIME __SYS_CLOCK_REALTIME
|
||||
#define CLOCK_MONOTONIC __SYS_CLOCK_MONOTONIC
|
||||
|
||||
struct timespec {
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
extern clock_t clock(void);
|
||||
extern time_t time(time_t *p);
|
||||
|
||||
extern int nanosleep(const struct timespec *req, struct timespec *rem);
|
||||
|
||||
extern struct tm *gmtime(const time_t *timer);
|
||||
extern struct tm *localtime(const time_t *timer);
|
||||
extern time_t mktime(struct tm *timeptr);
|
||||
extern size_t strftime(char *str, size_t max, const char *format, const struct tm *timeptr);
|
||||
|
||||
extern void tzset(void);
|
||||
|
||||
extern int clock_getres(clockid_t clk_id, struct timespec *res);
|
||||
extern int clock_gettime(clockid_t clk_id, struct timespec *tp);
|
||||
extern int clock_settime(clockid_t clk_id, const struct timespec *tp);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user