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