Unleashed v1.4
[unleashed.git] / share / man / man3volmgt / volmgt_release.3volmgt
blob0c801da6af292560864df2167c869b77c37b79b7
1 '\" te
2 .\"  Copyright (c) 1996, 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 VOLMGT_RELEASE 3VOLMGT "Mar 8, 2007"
7 .SH NAME
8 volmgt_release \- release removable media device reservation
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lvolmgt\fR [ \fIlibrary\fR ... ]
13 #include <volmgt.h>
17 \fBint\fR \fBvolmgt_release\fR(\fBchar *\fR\fIdev\fR);
18 .fi
20 .SH DESCRIPTION
21 .sp
22 .LP
23 This function is obsolete. The management of removable media by the Volume
24 Management feature, including \fBvold\fR, has been replaced by software that
25 supports the Hardware Abstraction Layer (HAL). Programmatic support for HAL is
26 through the HAL APIs, which are documented on the HAL web site. See
27 \fBhal\fR(5). The return value of this function is undefined.
28 .sp
29 .LP
30 The  \fBvolmgt_release()\fR routine releases the removable media device
31 reservation specified as \fIdev\fR. See \fBvolmgt_acquire\fR(3VOLMGT) for a
32 description of \fIdev\fR.
33 .sp
34 .LP
35 If  \fIdev\fR is reserved by the caller,  \fBvolmgt_release()\fR updates the
36 internal device reservation database to indicate  that the device is no longer
37 reserved. If the requested device is reserved by another process, the release
38 attempt fails and \fBerrno\fR is set to  \fB0\fR.
39 .SH RETURN VALUES
40 .sp
41 .LP
42 The return from this function is undefined.
43 .SH ERRORS
44 .sp
45 .LP
46 On failure, \fBvolmgt_release()\fR returns  \fB0\fR, and sets  \fBerrno\fR for
47 one of the following conditions:
48 .sp
49 .ne 2
50 .na
51 \fB\fBEINVAL\fR\fR
52 .ad
53 .RS 10n
54 \fIdev\fR was invalid or missing.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fBEBUSY\fR\fR
61 .ad
62 .RS 10n
63 \fIdev\fR was not reserved by the caller.
64 .RE
66 .SH EXAMPLES
67 .LP
68 \fBExample 1 \fRUsing \fBvolmgt_release()\fR
69 .sp
70 .LP
71 In the following example, volume management is running, and the first floppy
72 drive is reserved, accessed and released.
74 .sp
75 .in +2
76 .nf
77 #include <volmgt.h>
78 char *errp;
79 if (!volmgt_acquire("floppy0", "FileMgr", 0, &errp,
80     NULL)) {
81         /* handle error case */
82         .\|.\|.
84 /* floppy acquired - now access it */
85 if (!volmgt_release("floppy0")) {
86         /* handle error case */
87         .\|.\|.
89 .fi
90 .in -2
92 .SH ATTRIBUTES
93 .sp
94 .LP
95 See \fBattributes\fR(5) for descriptions of the following attributes:
96 .sp
98 .sp
99 .TS
100 box;
101 c | c
102 l | l .
103 ATTRIBUTE TYPE  ATTRIBUTE VALUE
105 MT-Level        MT-Safe
107 Interface Stability     Obsolete
110 .SH SEE ALSO
113 \fBvolmgt_acquire\fR(3VOLMGT), \fBattributes\fR(5), \fBhal\fR(5)