Ver código fonte

Add POSIX prototypes for time functions, to allow external code to build

more easily within gPXE.

Note that we don't have function bodies for these functions yet.
tags/v0.9.3
Michael Brown 18 anos atrás
pai
commit
c2352dc8de
2 arquivos alterados com 42 adições e 0 exclusões
  1. 20
    0
      src/include/sys/time.h
  2. 22
    0
      src/include/time.h

+ 20
- 0
src/include/sys/time.h Ver arquivo

@@ -0,0 +1,20 @@
1
+#ifndef _SYS_TIME_H
2
+#define _SYS_TIME_H
3
+
4
+#include <time.h>
5
+
6
+typedef unsigned long suseconds_t;
7
+
8
+struct timeval {
9
+	time_t tv_sec;		/* seconds */
10
+	suseconds_t tv_usec;	/* microseconds */
11
+};
12
+
13
+struct timezone {
14
+	int tz_minuteswest;	/* minutes W of Greenwich */
15
+	int tz_dsttime;		/* type of dst correction */
16
+};
17
+
18
+extern int gettimeofday ( struct timeval *tv, struct timezone *tz );
19
+
20
+#endif /* _SYS_TIME_H */

+ 22
- 0
src/include/time.h Ver arquivo

@@ -0,0 +1,22 @@
1
+#ifndef _TIME_H
2
+#define _TIME_H
3
+
4
+typedef unsigned long time_t;
5
+
6
+struct tm {
7
+	int tm_sec;	/* seconds */
8
+	int tm_min;	/* minutes */
9
+	int tm_hour;	/* hours */
10
+	int tm_mday;	/* day of the month */
11
+	int tm_mon;	/* month */
12
+	int tm_year;	/* year */
13
+	int tm_wday;	/* day of the week */
14
+	int tm_yday;	/* day in the year */
15
+	int tm_isdst;	/* daylight saving time */
16
+};
17
+
18
+extern time_t time ( time_t *t );
19
+
20
+extern time_t mktime ( struct tm *tm );
21
+
22
+#endif /* _TIME_H */

Carregando…
Cancelar
Salvar