xref: /illumos-gate/usr/src/cmd/dispadmin/dispadmin.h (revision a629ded1d7b2e67c2028ccbc5ba9099328cc4e1b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /*
27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 /*
32  *	Note that this file does not exist in the SVr4 base, but
33  *	is largely derived from sys/hrtcntl.h, hence the AT&T
34  *	copyright is propagated.  SVr4.0 1.9
35  */
36 
37 #pragma ident	"%Z%%M%	%I%	%E% SMI"
38 
39 /*
40  * The following is an excerpt from <sys/hrtcntl.h>. HRT timers are not
41  * supported by SunOS (which will support the POSIX definition). Dispadmin
42  * uses the hrt routine _hrtnewres because it coincidentally does the
43  * right thing. These defines allow this routine to be locally included
44  * in dispadmin (rather than exported in libc). This should be improved in
45  * the long term.
46  */
47 
48 /*
49  *	Definitions for specifying rounding mode.
50  */
51 
52 #define	HRT_TRUNC	0	/* Round results down.	*/
53 #define	HRT_RND		1	/* Round results (rnd up if fractional	*/
54 				/*   part >= .5 otherwise round down).	*/
55 #define	HRT_RNDUP	2	/* Always round results up.	*/
56 
57 /*
58  *	Structure used to represent a high-resolution time-of-day
59  *	or interval.
60  */
61 
62 typedef struct hrtimer {
63 	ulong_t	hrt_secs;	/* Seconds.				*/
64 	long	hrt_rem;	/* A value less than a second.		*/
65 	ulong_t	hrt_res;	/* The resolution of hrt_rem.		*/
66 } hrtimer_t;
67 
68 /*
69  * Functions in subr.c
70  */
71 extern void fatalerr(const char *, ...);
72 extern long hrtconvert(hrtimer_t *);
73 extern int _hrtnewres(hrtimer_t *, ulong_t, long);
74