4.2BSD/usr/man/man2/mount.2

Compare this file to the similar file:
Show the results in this format:

.TH MOUNT 2 "27 July 1983"
.UC 4
.SH NAME
mount, umount \- mount or remove file system
.SH SYNOPSIS
.nf
.ft B
mount(special, name, rwflag)
char *special, *name;
int rwflag;
.PP
.ft B
umount(special)
char *special;
.fi
.SH DESCRIPTION
.I Mount
announces to the system that a removable file system has
been mounted on
the block-structured special file
.I special;
from now on, references to file
.I name
will refer to
the root file on the newly mounted file system.
.I Special
and
.I name
are pointers to null-terminated strings
containing the appropriate path names.
.PP
.I Name
must exist already. 
.I Name
must be a directory.
Its old contents
are inaccessible while the file system
is mounted.
.PP
The
.I rwflag
argument determines whether
the file system can be written on; if it is 0 writing
is allowed, if non-zero no writing is done.
Physically write-protected and magnetic
tape file systems must be mounted read-only or
errors will occur when access times are updated,
whether or not any
explicit write is attempted.
.PP
.I Umount
announces to the system that the
.I special
file is no longer to contain a removable file system.
The associated file reverts to its ordinary interpretation.
.SH "RETURN VALUE
.I Mount
returns 0 if the action occurred, \-1 if
.I special
is inaccessible or not an appropriate file, if
.I name
does not exist, if
.I special
is already mounted, if
.I name
is in use, or if
there are already too many
file systems mounted.
.PP
.I Umount
returns 0 if the action occurred; \-1 if
if the special file is inaccessible or
does not have a mounted file system,
or if there are active files in the mounted 
file system.
.SH ERRORS
.I Mount
will fail when one of the following occurs:
.TP 15
[NODEV]
The caller is not the super-user.
.TP 15
[NODEV]
.I Special
does not exist.
.TP 15
[ENOTBLK]
.I Special
is not a block device.
.TP 15
[ENXIO]
The major device number of 
.I special
is out of range (this indicates no device driver exists
for the associated hardware).
.TP 15
[EPERM]
The pathname contains a character with the high-order bit set.
.TP 15
[ENOTDIR]
A component of the path prefix in
.I name
is not a directory.
.TP 15
[EROFS]
.I Name
resides on a read-only file system.
.TP 15
[EBUSY]
.I Name
is not a directory, or another process currently
holds a reference to it.
.TP 15
[EBUSY]
No space remains in the mount table.
.TP 15
[EBUSY]
The super block for the file system had a bad magic
number or an out of range block size.
.TP 15
[EBUSY]
Not enough memory was available to read the cylinder
group information for the file system.
.TP 15
[EBUSY]
An i/o error occurred while reading the super block or
cylinder group information.
.PP
.I Umount
may fail with one of the following errors:
.TP 15
[NODEV]
The caller is not the super-user.
.TP 15
[NODEV]
.I Special
does not exist.
.TP 15
[ENOTBLK]
.I Special
is not a block device.
.TP 15
[ENXIO]
The major device number of 
.I special
is out of range (this indicates no device driver exists
for the associated hardware).
.TP 15
[EINVAL]
The requested device is not in the mount table.
.TP 15
[EBUSY]
A process is holding a reference to a file located
on the file system.
.SH "SEE ALSO"
mount(8), umount(8)
.SH BUGS
The error codes are in a state of disarray; too many errors
appear to the caller as one value.