Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man8 / devreserv.8
blobcb3506486d1998bb2e49180b71d6fa057a5641b2
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1997 Sun Microsystems, Inc.  All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH DEVRESERV 8 "Jul 5, 1990"
7 .SH NAME
8 devreserv \- reserve devices for exclusive use
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBdevreserv\fR [\fIkey\fR [\fIdevice-list\fR]...]
13 .fi
15 .SH DESCRIPTION
16 .sp
17 .LP
18 \fBdevreserv\fR reserves devices for exclusive use. When the device is no
19 longer required, use  \fBdevfree\fR to release it.
20 .sp
21 .LP
22 \fBdevreserv\fR reserves at most one device per  \fIdevice-list\fR. Each list
23 is searched in linear order until the first available device is found. If a
24 device cannot be reserved from each list, the entire reservation fails.
25 .sp
26 .LP
27 When  \fBdevreserv\fR is invoked without arguments, it lists the devices that
28 are currently reserved and shows to which key it was reserved. When
29 \fBdevreserv\fR is invoked with only the  \fIkey\fR argument, it lists the
30 devices that are currently reserved to that key.
31 .SH OPERANDS
32 .sp
33 .LP
34 The following operands are supported:
35 .sp
36 .ne 2
37 .na
38 \fB\fIdevice-list\fR\fR
39 .ad
40 .RS 15n
41 Defines a list of devices that \fBdevreserv\fR will search to find an available
42 device. The list must be formatted as a single argument to the shell.
43 .RE
45 .sp
46 .ne 2
47 .na
48 \fB\fIkey\fR\fR
49 .ad
50 .RS 15n
51 Designates a unique key on which the device will be reserved. The key must be a
52 positive integer.
53 .RE
55 .SH EXAMPLES
56 .LP
57 \fBExample 1 \fRReserving a Floppy Disk and a Cartridge Tape
58 .sp
59 .LP
60 The following example reserves a floppy disk and a cartridge tape:
62 .sp
63 .in +2
64 .nf
65 $ key=$$
66 $ echo "The current Process ID is equal to: $key"
67   The Current Process ID is equal to: 10658
68 $ devreserv $key diskette1 ctape1
69 .fi
70 .in -2
71 .sp
73 .LP
74 \fBExample 2 \fRListing All Devices Currently Reserved
75 .sp
76 .LP
77 The following example lists all devices currently reserved:
79 .sp
80 .in +2
81 .nf
82 $ devreserv
83   disk1         2423
84   diskette1     10658
85   ctape1        10658
86 .fi
87 .in -2
88 .sp
90 .LP
91 \fBExample 3 \fRListing All Devices Currently Reserved to a Particular Key
92 .sp
93 .LP
94 The following example lists all devices currently reserved to a particular key:
96 .sp
97 .in +2
98 .nf
99 $ devreserv $key
100   diskette1
101   ctape1
103 .in -2
106 .SH EXIT STATUS
109 The following exit values are returned:
111 .ne 2
113 \fB\fB0\fR\fR
115 .RS 5n
116 Successful completion.
120 .ne 2
122 \fB\fB1\fR\fR
124 .RS 5n
125 Command syntax was incorrect, an invalid was option used, or an internal error
126 occurred.
130 .ne 2
132 \fB\fB2\fR\fR
134 .RS 5n
135 Device table or device reservation table could not be opened for reading.
139 .ne 2
141 \fB\fB3\fR\fR
143 .RS 5n
144 Device reservation request could not be fulfilled.
147 .SH FILES
149 .ne 2
151 \fB\fB/etc/device.tab\fR\fR
153 .RS 19n
158 .ne 2
160 \fB\fB/etc/devlkfile\fR\fR
162 .RS 19n
166 .SH SEE ALSO
169 \fBdevfree\fR(8), \fBattributes\fR(5)
170 .SH NOTES
173 The commands \fBdevreserv\fR and \fBdevfree\fR are used to manage the
174 availability of devices on a system. Their use is  on a participatory basis and
175 they do not place any  constraints on the actual access to the device. They
176 serve as a centralized bookkeeping point for those who wish to use them.
177 Devices which have been reserved  cannot be used by processes which utilize the
178 device reservation functions until the reservation has been canceled. However,
179 processes that do not use device reservation may use a device that has been
180 reserved since such a process would not have checked for its reservation
181 status.