improved english
[unix-history] / usr / src / lib / libc / sys / mount.2
CommitLineData
75f4d1ff
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
b5984ffe 5.\" @(#)mount.2 6.2 (Berkeley) %G%
75f4d1ff 6.\"
acbf19e9 7.TH MOUNT 2 ""
75f4d1ff
KM
8.UC 4
9.SH NAME
10mount, umount \- mount or remove file system
11.SH SYNOPSIS
12.nf
28e2febc
KM
13.ft B
14mount(special, name, rwflag)
15char *special, *name;
16int rwflag;
75f4d1ff 17.PP
28e2febc
KM
18.ft B
19umount(special)
20char *special;
75f4d1ff
KM
21.fi
22.SH DESCRIPTION
23.I Mount
24announces to the system that a removable file system has
25been mounted on
26the block-structured special file
27.I special;
28from now on, references to file
29.I name
30will refer to
31the root file on the newly mounted file system.
32.I Special
33and
34.I name
35are pointers to null-terminated strings
36containing the appropriate path names.
37.PP
38.I Name
39must exist already.
40.I Name
28e2febc 41must be a directory.
75f4d1ff
KM
42Its old contents
43are inaccessible while the file system
44is mounted.
45.PP
46The
47.I rwflag
48argument determines whether
49the file system can be written on; if it is 0 writing
50is allowed, if non-zero no writing is done.
51Physically write-protected and magnetic
52tape file systems must be mounted read-only or
53errors will occur when access times are updated,
54whether or not any
55explicit write is attempted.
56.PP
57.I Umount
58announces to the system that the
59.I special
60file is no longer to contain a removable file system.
61The associated file reverts to its ordinary interpretation.
28e2febc 62.SH "RETURN VALUE
75f4d1ff 63.I Mount
28e2febc 64returns 0 if the action occurred, \-1 if
75f4d1ff 65.I special
28e2febc 66is inaccessible or not an appropriate file, if
75f4d1ff 67.I name
28e2febc 68does not exist, if
75f4d1ff 69.I special
28e2febc 70is already mounted, if
75f4d1ff 71.I name
28e2febc 72is in use, or if
75f4d1ff
KM
73there are already too many
74file systems mounted.
75.PP
76.I Umount
77returns 0 if the action occurred; \-1 if
78if the special file is inaccessible or
79does not have a mounted file system,
80or if there are active files in the mounted
81file system.
28e2febc
KM
82.SH ERRORS
83.I Mount
84will fail when one of the following occurs:
85.TP 15
b5984ffe
KM
86[ENAMETOOLONG]
87A component of either pathname exceeded 255 characters,
88or the entire length of either path name exceeded 1023 characters.
89.TP 15
90[ELOOP]
91Too many symbolic links were encountered in translating either pathname.
92.TP 15
93[EPERM]
28e2febc
KM
94The caller is not the super-user.
95.TP 15
b5984ffe
KM
96[ENOENT]
97A component of \fIname\fP does not exist.
98.TP 15
99[ENODEV]
100A component of \fIspecial\fP does not exist.
28e2febc
KM
101.TP 15
102[ENOTBLK]
103.I Special
104is not a block device.
105.TP 15
106[ENXIO]
107The major device number of
108.I special
109is out of range (this indicates no device driver exists
110for the associated hardware).
111.TP 15
28e2febc 112[ENOTDIR]
b5984ffe
KM
113A component of \fIname\fP is not a directory,
114or a path prefix of \fIspecial\fP is not a directory.
28e2febc 115.TP 15
b5984ffe
KM
116[EINVAL]
117Either pathname contains a character with the high-order bit set.
28e2febc 118.TP 15
b5984ffe 119[EINVAL]
28e2febc
KM
120The super block for the file system had a bad magic
121number or an out of range block size.
122.TP 15
123[EBUSY]
b5984ffe
KM
124Another process currently holds a reference to
125.IR name ,
126or \fIspecial\fP is already mounted.
127.TP 15
128[EMFILE]
129No space remains in the mount table.
130.TP 15
131[ENOMEM]
28e2febc
KM
132Not enough memory was available to read the cylinder
133group information for the file system.
134.TP 15
b5984ffe 135[EIO]
28e2febc
KM
136An i/o error occurred while reading the super block or
137cylinder group information.
75f4d1ff 138.PP
28e2febc
KM
139.I Umount
140may fail with one of the following errors:
141.TP 15
b5984ffe
KM
142[ENOTDIR]
143A component of the path prefix is not a directory.
144.TP 15
145[EINVAL]
146The pathname contains a character with the high-order bit set.
147.TP 15
148[ENAMETOOLONG]
149A component of a pathname exceeded 255 characters,
150or an entire path name exceeded 1023 characters.
151.TP 15
152[ELOOP]
153Too many symbolic links were encountered in translating the pathname.
154.TP 15
155[EPERM]
28e2febc
KM
156The caller is not the super-user.
157.TP 15
b5984ffe 158[ENODEV]
28e2febc
KM
159.I Special
160does not exist.
161.TP 15
162[ENOTBLK]
163.I Special
164is not a block device.
165.TP 15
166[ENXIO]
167The major device number of
168.I special
169is out of range (this indicates no device driver exists
170for the associated hardware).
171.TP 15
172[EINVAL]
173The requested device is not in the mount table.
174.TP 15
175[EBUSY]
176A process is holding a reference to a file located
177on the file system.
178.SH "SEE ALSO"
179mount(8), umount(8)
180.SH BUGS
b5984ffe 181Some of the error codes need translation to more obvious messages.