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