mount(3) mount(3)NAME mount - mount a file system SYNOPSIS int mount(spec, dir, rwflag) char *spec, *dir; int rwflag; DESCRIPTION mount requests that a removable file system contained on the block special file identified by spec be mounted on the directory identified by dir. spec and dir are pointers to path names. Upon successful completion, references to the file dir will refer to the root directory on the mounted file system. The low-order bit of rwflag is used to control write permis- sion on the mounted file system; if 1, writing is forbidden, otherwise writing is permitted according to individual file accessibility. 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. mount may be invoked only by the superuser. ERRORS mount will fail if one or more of the following are true: [EPERM] The effective user ID is not superuser. [ENOENT] Any of the named files does not exist. [ENOTDIR] A component of a path prefix is not a directo- ry. [ENOTBLK] spec is not a block special device. [ENXIO] The device associated with spec does not ex- ist. [ENOTDIR] dir is not a directory. [EFAULT] spec or dir points outside the allocated ad- dress space of the process. [EBUSY] dir is currently mounted on, is someone's current working directory, or is otherwise busy. [EPERM] A pathname contains a character with the April, 1990 1
mount(3) mount(3)high-order bit set. [ENAMETOOLONG] A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX. [ELOOP] Too many symbolic links were encountered in translating a pathname. [EBUSY] The device associated with spec is currently mounted. [EBUSY] There are no more mount table entries. RETURN VALUE Upon successful completion a value of 0 is returned. Other- wise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO fsmount(2), unmount(2), umount(3), fstab(4). 2 April, 1990