Add POSIX prototypes for time functions, to allow external code to build
authorMichael Brown <mcb30@etherboot.org>
Fri, 19 Jan 2007 03:09:22 +0000 (03:09 +0000)
committerMichael Brown <mcb30@etherboot.org>
Fri, 19 Jan 2007 03:09:22 +0000 (03:09 +0000)
more easily within gPXE.

Note that we don't have function bodies for these functions yet.

src/include/sys/time.h [new file with mode: 0644]
src/include/time.h [new file with mode: 0644]

diff --git a/src/include/sys/time.h b/src/include/sys/time.h
new file mode 100644 (file)
index 0000000..21fb7e9
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _SYS_TIME_H
+#define _SYS_TIME_H
+
+#include <time.h>
+
+typedef unsigned long suseconds_t;
+
+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 );
+
+#endif /* _SYS_TIME_H */
diff --git a/src/include/time.h b/src/include/time.h
new file mode 100644 (file)
index 0000000..6ea927c
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _TIME_H
+#define _TIME_H
+
+typedef unsigned long time_t;
+
+struct tm {
+       int tm_sec;     /* seconds */
+       int tm_min;     /* minutes */
+       int tm_hour;    /* hours */
+       int tm_mday;    /* day of the month */
+       int tm_mon;     /* month */
+       int tm_year;    /* year */
+       int tm_wday;    /* day of the week */
+       int tm_yday;    /* day in the year */
+       int tm_isdst;   /* daylight saving time */
+};
+
+extern time_t time ( time_t *t );
+
+extern time_t mktime ( struct tm *tm );
+
+#endif /* _TIME_H */