mount(2)
NAME
mount, umount − mount or remove file system
SYNTAX
int mount(special, name, rwflag)
char *special, *name;
int rwflag
int umount(special)
char *special;
DESCRIPTION
The mount system call announces to the system that a removable file system has been mounted on the block-structured special file specified by special. From then on, references to file name will refer to the root directory of the mounted file system. Both special and name are pointers to null-terminated strings containing the appropriate path names.
The name must exist already and 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 determines whether the file system can be written on: if 0, writing is allowed; if non-zero, no writing is allowed. Physically write-protected and magnetic tape file systems must be mounted read-only. Otherwise, errors will occur when access times are updated, whether or not any explicit write is attempted.
The umount system call 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.
RESTRICTIONS
Both the mount and umount calls can be invoked only by the superuser.
DIAGNOSTICS
The mount call will fail if:
[EACCES] A component of the path prefix denies search permission.
[EBADFS] Either the superblock consistency checks failed, or a superblock is corrupted, or no file system exists on the device.
[EBUSY] Either the name specified is not a directory, or another process currently holds a reference to name.
[EBUSY] No space remains in the mount table.
[ENODEV] The special file does not exist.
[ENOENT] An element within name does not exist.
[ENOTBLK] The special file 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] The specified name resides on a read-only file system.
[EFAULT] The special file points to an illegal address.
The umount call will fail if:
[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.
[ENOENT] The named file does not exist.
[ENODEV] The special file does not exist.
[ENOTBLK] The special file 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).
[ENOTDIR] A component of the path prefix in special or name is not a directory.
[EPERM] The process’s effective user ID is not the superuser.
[EFAULT] The special file points to an illegal address.
ASSEMBLER
(mount = 21.)
sys mount; special; name; rwflag
(umount = 22.)
sys umount; special