xref: /titanic_51/usr/src/uts/common/sys/utssys.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate /*
27*7c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
28*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
29*7c478bd9Sstevel@tonic-gate  */
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #ifndef _SYS_UTSSYS_H
32*7c478bd9Sstevel@tonic-gate #define	_SYS_UTSSYS_H
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1 */
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
37*7c478bd9Sstevel@tonic-gate extern "C" {
38*7c478bd9Sstevel@tonic-gate #endif
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate /*
41*7c478bd9Sstevel@tonic-gate  * Definitions related to the utssys() system call.
42*7c478bd9Sstevel@tonic-gate  */
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate /*
45*7c478bd9Sstevel@tonic-gate  * "commands" of utssys
46*7c478bd9Sstevel@tonic-gate  */
47*7c478bd9Sstevel@tonic-gate #define	UTS_UNAME	0x0	/* obsolete */
48*7c478bd9Sstevel@tonic-gate #define	UTS_USTAT	0x2	/* 1 was umask */
49*7c478bd9Sstevel@tonic-gate #define	UTS_FUSERS	0x3
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate /*
52*7c478bd9Sstevel@tonic-gate  * Flags to UTS_FUSERS
53*7c478bd9Sstevel@tonic-gate  */
54*7c478bd9Sstevel@tonic-gate #define	F_FILE_ONLY	0x01
55*7c478bd9Sstevel@tonic-gate #define	F_CONTAINED	0x02
56*7c478bd9Sstevel@tonic-gate #define	F_NBMANDLIST	0x04	/* Only NBMAND locks users */
57*7c478bd9Sstevel@tonic-gate #define	F_DEVINFO	0x08	/* get device usage info for a dip instead */
58*7c478bd9Sstevel@tonic-gate 				/* of a minor node */
59*7c478bd9Sstevel@tonic-gate #define	F_KINFO_COUNT	0x10	/* get the current number of kernel */
60*7c478bd9Sstevel@tonic-gate 				/* device consumers */
61*7c478bd9Sstevel@tonic-gate 
62*7c478bd9Sstevel@tonic-gate /*
63*7c478bd9Sstevel@tonic-gate  * structures yielded by UTS_FUSERS
64*7c478bd9Sstevel@tonic-gate  */
65*7c478bd9Sstevel@tonic-gate typedef struct f_user {
66*7c478bd9Sstevel@tonic-gate 	int	fu_flags;	/* see below */
67*7c478bd9Sstevel@tonic-gate 	union {
68*7c478bd9Sstevel@tonic-gate 		struct {
69*7c478bd9Sstevel@tonic-gate 			pid_t	u_pid;
70*7c478bd9Sstevel@tonic-gate 			uid_t	u_uid;
71*7c478bd9Sstevel@tonic-gate 		} u_info;
72*7c478bd9Sstevel@tonic-gate 		struct {
73*7c478bd9Sstevel@tonic-gate 			int	k_modid;
74*7c478bd9Sstevel@tonic-gate 			int	k_instance;
75*7c478bd9Sstevel@tonic-gate 			int	k_minor;
76*7c478bd9Sstevel@tonic-gate 		} k_info;
77*7c478bd9Sstevel@tonic-gate 	} fu_info;
78*7c478bd9Sstevel@tonic-gate } f_user_t;
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate typedef struct fu_data {
81*7c478bd9Sstevel@tonic-gate 	int		fud_user_max;
82*7c478bd9Sstevel@tonic-gate 	int		fud_user_count;
83*7c478bd9Sstevel@tonic-gate 	struct f_user	fud_user[1];
84*7c478bd9Sstevel@tonic-gate } fu_data_t;
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate /*
87*7c478bd9Sstevel@tonic-gate  * defines to simplify access to members of the f_user_t structure
88*7c478bd9Sstevel@tonic-gate  */
89*7c478bd9Sstevel@tonic-gate #define	fu_pid		fu_info.u_info.u_pid
90*7c478bd9Sstevel@tonic-gate #define	fu_uid		fu_info.u_info.u_uid
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate #define	fu_modid	fu_info.k_info.k_modid
93*7c478bd9Sstevel@tonic-gate #define	fu_instance	fu_info.k_info.k_instance
94*7c478bd9Sstevel@tonic-gate #define	fu_minor	fu_info.k_info.k_minor
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate #define	fu_data_size(x)	(sizeof (fu_data_t) - sizeof (f_user_t) + \
97*7c478bd9Sstevel@tonic-gate 				((x) * sizeof (f_user_t)))
98*7c478bd9Sstevel@tonic-gate 
99*7c478bd9Sstevel@tonic-gate /*
100*7c478bd9Sstevel@tonic-gate  * fu_flags values
101*7c478bd9Sstevel@tonic-gate  */
102*7c478bd9Sstevel@tonic-gate #define	F_CDIR		0x1
103*7c478bd9Sstevel@tonic-gate #define	F_RDIR		0x2
104*7c478bd9Sstevel@tonic-gate #define	F_TEXT		0x4
105*7c478bd9Sstevel@tonic-gate #define	F_MAP		0x8
106*7c478bd9Sstevel@tonic-gate #define	F_OPEN		0x10
107*7c478bd9Sstevel@tonic-gate #define	F_TRACE		0x20
108*7c478bd9Sstevel@tonic-gate #define	F_TTY		0x40
109*7c478bd9Sstevel@tonic-gate #define	F_NBM		0x80	/* NBMAND lock in place */
110*7c478bd9Sstevel@tonic-gate #define	F_KERNEL	0x80000000
111*7c478bd9Sstevel@tonic-gate 
112*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
113*7c478bd9Sstevel@tonic-gate }
114*7c478bd9Sstevel@tonic-gate #endif
115*7c478bd9Sstevel@tonic-gate 
116*7c478bd9Sstevel@tonic-gate #endif /* _SYS_UTSSYS_H */
117