xref: /titanic_50/usr/src/lib/libbc/inc/include/sys/time.h (revision 142c9f13e148d687426ed2d4e8bd93717eeaebbc)
1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 /*
4  * Copyright (c) 1982, 1986 Regents of the University of California.
5  * All rights reserved.  The Berkeley software License Agreement
6  * specifies the terms and conditions for redistribution.
7  */
8 
9 #ifndef _sys_time_h
10 #define _sys_time_h
11 
12 /*
13  * Structure returned by gettimeofday(2) system call,
14  * and used in other calls.
15  */
16 struct timeval {
17 	long	tv_sec;		/* seconds */
18 	long	tv_usec;	/* and microseconds */
19 };
20 
21 struct timezone {
22 	int	tz_minuteswest;	/* minutes west of Greenwich */
23 	int	tz_dsttime;	/* type of dst correction */
24 };
25 #define	DST_NONE	0	/* not on dst */
26 #define	DST_USA		1	/* USA style dst */
27 #define	DST_AUST	2	/* Australian style dst */
28 #define	DST_WET		3	/* Western European dst */
29 #define	DST_MET		4	/* Middle European dst */
30 #define	DST_EET		5	/* Eastern European dst */
31 #define	DST_CAN		6	/* Canada */
32 #define	DST_GB		7	/* Great Britain and Eire */
33 #define	DST_RUM		8	/* Rumania */
34 #define	DST_TUR		9	/* Turkey */
35 #define	DST_AUSTALT	10	/* Australian style with shift in 1986 */
36 
37 /*
38  * Operations on timevals.
39  *
40  * NB: timercmp does not work for >= or <=.
41  */
42 #define	timerisset(tvp)		((tvp)->tv_sec || (tvp)->tv_usec)
43 #define	timercmp(tvp, uvp, cmp)	\
44 	((tvp)->tv_sec cmp (uvp)->tv_sec || \
45 	 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
46 #define	timerclear(tvp)		(tvp)->tv_sec = (tvp)->tv_usec = 0
47 
48 /*
49  * Names of the interval timers, and structure
50  * defining a timer setting.
51  */
52 #define	ITIMER_REAL	0
53 #define	ITIMER_VIRTUAL	1
54 #define	ITIMER_PROF	2
55 
56 struct	itimerval {
57 	struct	timeval it_interval;	/* timer interval */
58 	struct	timeval it_value;	/* current value */
59 };
60 
61 #ifndef KERNEL
62 #include <time.h>
63 #endif
64 
65 #endif /*!_sys_time_h*/
66