Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / include / time.h
1 #ifndef _TIME_H
2 #define _TIME_H
3
4 /** @file
5  *
6  * Date and time
7  */
8
9 FILE_LICENCE ( GPL2_OR_LATER );
10
11 #include <sys/time.h>
12 #include <ipxe/time.h>
13
14 /** Broken-down time */
15 struct tm {
16         /** Seconds [0,60] */
17         int tm_sec;
18         /** Minutes [0,59] */
19         int tm_min;
20         /** Hour [0,23] */
21         int tm_hour;
22         /** Day of month [1,31] */
23         int tm_mday;
24         /** Month of year [0,11] */
25         int tm_mon;
26         /** Years since 1900 */
27         int tm_year;
28         /** Day of week [0,6] (Sunday=0) */
29         int tm_wday;
30         /** Day of year [0,365] */
31         int tm_yday;
32         /** Daylight savings flag */
33         int tm_isdst;
34 };
35
36 /**
37  * Get current time in seconds since the Epoch
38  *
39  * @v t                 Time to fill in, or NULL
40  * @ret time            Current time
41  */
42 static inline time_t time ( time_t *t ) {
43         time_t now;
44
45         now = time_now();
46         if ( t )
47                 *t = now;
48         return now;
49 }
50
51 extern time_t mktime ( struct tm *tm );
52
53 #endif /* _TIME_H */