Moving some definitions from time.h into sys/time.h

This commit is contained in:
Ali Mashtizadeh 2015-02-02 15:29:12 -08:00
parent 78afc5e47d
commit 348a7acc15
4 changed files with 21 additions and 19 deletions

View File

@ -2,9 +2,6 @@
#ifndef __TIME_H__ #ifndef __TIME_H__
#define __TIME_H__ #define __TIME_H__
typedef uint64_t time_t;
typedef uint64_t suseconds_t;
struct tm { struct tm {
int tm_sec; int tm_sec;
int tm_min; int tm_min;
@ -17,17 +14,6 @@ struct tm {
int tm_isdst; 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); time_t time(time_t *t);
char *asctime_r(const struct tm *tm, char *buf); char *asctime_r(const struct tm *tm, char *buf);
char *asctime(const struct tm *tm); 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); struct tm *localtime_r(const time_t *timep, struct tm *result);
time_t mktime(struct tm *tm); 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__ */ #endif /* __TIME_H__ */

View File

@ -4,6 +4,8 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <sys/time.h>
#include <syscall.h> #include <syscall.h>
#define TZ_OFFSET_SECS 0 #define TZ_OFFSET_SECS 0

View File

@ -2,7 +2,23 @@
#ifndef __SYS_TIME_H__ #ifndef __SYS_TIME_H__
#define __SYS_TIME_H__ #define __SYS_TIME_H__
#include <sys/types.h>
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__ */ #endif /* __SYS_TIME_H__ */

View File

@ -22,6 +22,9 @@ typedef int64_t fpos_t;
typedef uint64_t ino_t; typedef uint64_t ino_t;
typedef uint64_t time_t;
typedef uint64_t suseconds_t;
#define NULL ((void *)0) #define NULL ((void *)0)
#endif /* __SYS_TYPES_H__ */ #endif /* __SYS_TYPES_H__ */