[libc] Add mktime() function

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-03-19 16:09:41 +00:00
parent 0b2c7885c7
commit bd6805a8c1
3 changed files with 173 additions and 25 deletions

View File

@@ -1,20 +1,18 @@
#ifndef _SYS_TIME_H
#define _SYS_TIME_H
#include <time.h>
/** @file
*
* Date and time
*/
typedef unsigned long suseconds_t;
#include <stdint.h>
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
struct timezone {
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
extern int gettimeofday ( struct timeval *tv, struct timezone *tz );
/** Seconds since the Epoch
*
* We use a 64-bit type to avoid Y2K38 issues, since we may have to
* handle distant future dates (e.g. X.509 certificate expiry dates).
*/
typedef int64_t time_t;
#endif /* _SYS_TIME_H */