MOUNT(2)
NAME
mount, umount − mount or remove file system
SYNOPSIS
mount(special, name, rwflag)
char *special, *name;
umount(special)
char *special;
DESCRIPTION
Mount announces to the system that a removable file system has been mounted on the block-structured special file special; from now on, references to file name will refer to the root file on the newly mounted file system. Special and name are pointers to null-terminated strings containing the appropriate path names.
Name must exist already. Name must be a directory (unless the root of the mounted file system is not a directory). Its old contents are inaccessible while the file system is mounted.
The 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.
Umount announces to the system that the special file is no longer to contain a removable file system. The associated file reverts to its ordinary interpretation.
DIAGNOSTICS
Mount will fail if:
[EACCES] A component of the path prefix denies search permission.
[EBUSY] Name is not a directory or another process currently holds a reference to it.
[EBUSY] No space remains in the mount table.
[ENODEV] Special does not exist.
[ENOENT] An element within name does not exist.
[ENOTBLK] Special is not for a block oriented device.
[ENOTDIR] A component of the path prefix in special or name is not a directory.
[ENXIO] The major device number of special is out of range (this indicates no device driver exists for the associated hardware).
[EPERM] The process’s effective user ID is not the superuser.
[EROFS] Name resides on a read-only file system.
Umount may fail with one of the following errors:
[EBUSY] A process is holding a reference to a file located on the file system.
[EINVAL] The requested device is not in the mount table.
[ENODEV] Special does not exist.
[ENOTBLK] Special is not a block device.
[ENXIO] The major device number of special is out of range (this indicates no device driver exists for the associated hardware).
[EPERM] The process’s effective user ID is not the superuser.
SEE ALSO
ASSEMBLER
(mount = 21.)
sys mount; special; name; rwflag
(umount = 22.)
sys umount; special