mount(3) mount(3)NAME mount - mounts 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 pathnames. 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 permission 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. STATUS MESSAGES AND VALUES Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. The mount program 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 directory. ENOTBLK spec is not a block special device. ENXIO The device associated with spec does not exist. ENOTDIR dir is not a directory. January 1992 1
mount(3) mount(3)EFAULT spec or dir points outside the allocated address 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 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. SEE ALSO fsmount(2), unmount(2), umount(3), fstab(4) 2 January 1992