puname: do not support modifying arbitrary processes
[unleashed.git] / include / devmgmt.h
blob142d31a5d119b26b5a9a4278d153d35d332c2a36
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 /* All Rights Reserved */
26 #ifndef _DEVMGMT_H
27 #define _DEVMGMT_H
29 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.12 */
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
36 * devmgmt.h
38 * Contents:
39 * - Device Management definitions,
40 * - getvol() definitions
44 * Device management definitions
45 * - Default pathnames (relative to installation point)
46 * - Environment variable namess
47 * - Standard field names in the device table
48 * - Flags
49 * - Miscellaneous definitions
54 * Default pathnames (relative to the package installation
55 * point) to the files used by Device Management:
57 * DTAB_PATH Device table
58 * DGRP_PATH Device group table
59 * DVLK_PATH Device reservation table
62 #define DTAB_PATH "/etc/device.tab"
63 #define DGRP_PATH "/etc/dgroup.tab"
64 #define DVLK_PATH "/etc/devlkfile"
68 * Names of environment variables
70 * OAM_DEVTAB Name of variable that defines the pathname to
71 * the device-table file
72 * OAM_DGROUP Name of variable that defines the pathname to
73 * the device-group table file
74 * OAM_DEVLKTAB Name of variable that defines the pathname to
75 * the device-reservation table file
78 #define OAM_DEVTAB "OAM_DEVTAB"
79 #define OAM_DGROUP "OAM_DGROUP"
80 #define OAM_DEVLKTAB "OAM_DEVLKTAB"
84 * Standard field names in the device table
87 #define DTAB_ALIAS "alias"
88 #define DTAB_CDEVICE "cdevice"
89 #define DTAB_BDEVICE "bdevice"
90 #define DTAB_PATHNAME "pathname"
94 * Flags:
95 * For getdev() and getdgrp():
96 * DTAB_ANDCRITERIA Devices must meet all criteria
97 * instead of any of the criteria
98 * DTAB_EXCLUDEFLAG The list of devices or device groups
99 * is the list that is to be excluded,
100 * not those to select from.
101 * DTAB_LISTALL List all device groups, even those that
102 * have no valid members (getdgrp() only).
105 #define DTAB_ANDCRITERIA 0x01
106 #define DTAB_EXCLUDEFLAG 0x02
107 #define DTAB_LISTALL 0x04
111 * Miscellaneous Definitions
113 * DTAB_MXALIASLN Maximum alias length
116 #define DTAB_MXALIASLN 14
119 * Device Management Structure definitions
120 * reservdev Reserved device description
124 * struct reservdev
126 * Structure describes a reserved device.
128 * Elements:
129 * char *devname Alias of the reserved device
130 * pid_t key Key used to reserve the device
133 struct reservdev {
134 char *devname;
135 pid_t key;
139 * Device Management Functions:
141 * devattr() Returns a device's attribute
142 * devreserv() Reserves a device
143 * devfree() Frees a reserved device
144 * reservdev() Return list of reserved devices
145 * getdev() Get devices that match criteria
146 * getdgrp() Get device-groups containing devices
147 * that match criteria
148 * listdev() List attributes defined for a device
149 * listdgrp() List members of a device-group
152 char *devattr(char *, char *);
153 int devfree(int, char *);
154 char **devreserv(int, char ***);
155 char **getdev(char **, char **, int);
156 char **getdgrp(char **, char **, int);
157 char **listdev(char *);
158 char **listdgrp(char *);
159 struct reservdev **reservdev(void);
162 * getvol() definitions
165 #define DM_BATCH 0x0001
166 #define DM_ELABEL 0x0002
167 #define DM_FORMAT 0x0004
168 #define DM_FORMFS 0x0008
169 #define DM_WLABEL 0x0010
170 #define DM_OLABEL 0x0020
172 int getvol(char *, char *, int, char *);
174 #ifdef __cplusplus
176 #endif
178 #endif /* _DEVMGMT_H */