New developer version 0.6.8; added select () function; added demonstrating example...
[ZeXOS.git] / libc / include / sys / time.h
blob5ce53e4ed6ff0a1b9d800d46297f7dfd98ebbcf0
1 /*
2 * ZeX/OS
3 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _SYS_TIME_H
20 #define _SYS_TIME_H
22 struct timeval {
23 long tv_sec; /* seconds */
24 long tv_usec; /* microseconds */
27 struct timezone {
28 int tz_minuteswest; /* minutes west of Greenwich */
29 int tz_dsttime; /* type of DST correction */
32 enum {
33 DST_NONE, /* not on dst */
34 DST_USA, /* USA style dst */
35 DST_AUST, /* Australian style dst */
36 DST_WET, /* Western European dst */
37 DST_MET, /* Middle European dst */
38 DST_EET, /* Eastern European dst */
39 DST_CAN, /* Canada */
40 DST_GB, /* Great Britain and Eire */
41 DST_RUM, /* Rumania */
42 DST_TUR, /* Turkey */
43 DST_AUSTALT /* Australian style with shift in 1986 */
46 #define timerisset(tvp)\
47 ((tvp)->tv_sec || (tvp)->tv_usec)
48 #define timercmp(tvp, uvp, cmp)\
49 ((tvp)->tv_sec cmp (uvp)->tv_sec ||\
50 (tvp)->tv_sec == (uvp)->tv_sec &&\
51 (tvp)->tv_usec cmp (uvp)->tv_usec)
52 #define timerclear(tvp)\
53 ((tvp)->tv_sec = (tvp)->tv_usec = 0)
55 extern int gettimeofday (struct timeval *tv, struct timezone *tz);
57 #endif