diff --git a/include/time.h b/include/time.h index 4566d84..ca79696 100644 --- a/include/time.h +++ b/include/time.h @@ -2,9 +2,6 @@ #ifndef __TIME_H__ #define __TIME_H__ -typedef uint64_t time_t; -typedef uint64_t suseconds_t; - struct tm { int tm_sec; int tm_min; @@ -17,17 +14,6 @@ struct tm { int tm_isdst; }; -struct timeval -{ - time_t tv_sec; - suseconds_t tv_usec; -}; - -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - time_t time(time_t *t); char *asctime_r(const struct tm *tm, char *buf); char *asctime(const struct tm *tm); @@ -39,10 +25,5 @@ struct tm *localtime(const time_t *timep); struct tm *localtime_r(const time_t *timep, struct tm *result); time_t mktime(struct tm *tm); -int gettimeofday(struct timeval *tv, struct timezone *tz); - -// XXX: Not implemented -int settimeofday(const struct timeval *tv, const struct timezone *tz); - #endif /* __TIME_H__ */ diff --git a/lib/libc/time.c b/lib/libc/time.c index db97342..55fe559 100644 --- a/lib/libc/time.c +++ b/lib/libc/time.c @@ -4,6 +4,8 @@ #include #include +#include + #include #define TZ_OFFSET_SECS 0 diff --git a/sys/include/time.h b/sys/include/time.h index 981b827..faa578b 100644 --- a/sys/include/time.h +++ b/sys/include/time.h @@ -2,7 +2,23 @@ #ifndef __SYS_TIME_H__ #define __SYS_TIME_H__ +#include +struct timeval +{ + time_t tv_sec; + suseconds_t tv_usec; +}; + +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; + +int gettimeofday(struct timeval *tv, struct timezone *tz); + +// XXX: Not implemented +int settimeofday(const struct timeval *tv, const struct timezone *tz); #endif /* __SYS_TIME_H__ */ diff --git a/sys/include/types.h b/sys/include/types.h index 3216f5f..bd3c7f4 100644 --- a/sys/include/types.h +++ b/sys/include/types.h @@ -22,6 +22,9 @@ typedef int64_t fpos_t; typedef uint64_t ino_t; +typedef uint64_t time_t; +typedef uint64_t suseconds_t; + #define NULL ((void *)0) #endif /* __SYS_TYPES_H__ */