2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH UMOUNT 2 "Aug 4, 2008"
9 umount, umount2 \- unmount a file system
13 #include <sys/mount.h>
15 \fBint\fR \fBumount\fR(\fBconst char *\fR\fIfile\fR);
20 \fBint\fR \fBumount2\fR(\fBconst char *\fR\fIfile\fR, \fBint\fR \fImflag\fR);
26 The \fBumount()\fR function requests that a previously mounted file system
27 contained on a block special device or directory be unmounted. The \fIfile\fR
28 argument is a pointer to the absolute pathname of the file system to be
29 unmounted. After unmounting the file system, the directory upon which the file
30 system was mounted reverts to its ordinary interpretation.
33 The \fBumount2()\fR function is identical to \fBumount()\fR, with the
34 additional capability of unmounting file systems even if there are open files
35 active. The \fImflag\fR argument must contain one of the following values:
42 Perform a normal unmount that is equivalent to \fBumount()\fR. The
43 \fBumount2()\fR function returns \fBEBUSY\fR if there are open files active
44 within the file system to be unmounted.
53 Unmount the file system, even if there are open files active. A forced unmount
54 can result in loss of data, so it should be used only when a regular unmount is
55 unsuccessful. The \fBumount2()\fR function returns \fBENOTSUP\fR if the
56 specified file systems does not support \fBMS_FORCE\fR. Only file systems of
57 type \fBnfs\fR, \fBufs\fR, \fBpcfs\fR, and \fBzfs\fR support \fBMS_FORCE\fR.
63 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
64 returned and \fBerrno\fR is set to indicate the error.
68 The \fBumount()\fR and \fBumount2()\fR functions will fail if:
75 The permission bits of the mount point do not permit read/write access or
76 search permission is denied on a component of the path prefix.
78 The calling process is not the owner of the mountpoint.
80 The mountpoint is not a regular file or a directory and the caller does not
81 have all privileges available in a its zone.
83 The special device device does not permit read access in the case of read-only
84 mounts or read-write access in the case of read/write mounts.
93 A file on \fIfile\fR is busy.
102 The file pointed to by \fIfile\fR points to an illegal address.
111 The file pointed to by \fIfile\fR is not mounted.
120 Too many symbolic links were encountered in translating the path pointed to by
127 \fB\fBENAMETOOLONG\fR\fR
130 The length of the \fIfile\fR argument exceeds \fIPATH_MAX\fR, or the length of
131 a \fIfile\fR component exceeds \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is
141 The file pointed to by \fIfile\fR does not exist or is not an absolute path.
150 The file pointed to by \fIfile\fR is on a remote machine and the link to that
151 machine is no longer active.
160 The file pointed to by \fIfile\fR is not a block special device.
169 The {\fBPRIV_SYS_MOUNT\fR} privilege is not asserted in the effective set of
179 The file pointed to by \fIfile\fR is remote.
184 The \fBumount2()\fR function will fail if:
191 The file pointed to by \fIfile\fR does not support this operation.
197 The \fBumount()\fR and \fBumount2()\fR functions can be invoked only by a
198 process that has the {\fBPRIV_SYS_MOUNT\fR} privilege asserted in its effective
202 Because it provides greater functionality, the \fBumount2()\fR function is
207 \fBmount\fR(2), \fBprivileges\fR(5)