.TH MOUNT 2 .UC 4 .SH NAME mount, umount \- mount and unmount filesystems. .SH SYNOPSIS .nf .B #incldue .B int mount (const char *devname, const char *dirname, int rw_flag); .B int umount (const char *devname); .fi .SH DESCRIPTION .B mount() mounts the filesystem on the block device named .I *devname onto the directory .I dirname .PP .B umount() unmounts the specified block device. .PP 0 is returned on success, a negative value on error. .SH ERRORS .B -EBUSY is returned under the following conditions: .br .IP 1. There is activity in the directory you are trying to mount on .IP 2. You are attempting to mount on /. .IP 3. There is file system activity during umount, which could be as simple as a process having a directory under the mount point as wd. .PP .B -ENOENT is returned if the block device or directory does not exist. .PP .B -ENOTBLK is returned if you attempt to unmount a non-block device. .PP .B -EPERM is returned under the following conditions: .br .IP 1. You attempt to mount a non-block device. .IP 2. You attempt to mount on a non-directory. .IP 3. The filesystem is already mounted. .SH FILES linux/fs/super.c .br /usr/include/linux/sys.h .br /usr/include/unistd.h .SH BUGS .I rw_flag is ignored. .PP non-super users may make .B mount() and .B umount() calls. .PP It is impossible to mount over root, as with BSD. This can be considered a feature or misfeature depending on you you look at it - as root will always be busy and probably shouldn't be mounted over. .PP .B EBUSY, ENOTBLK, and .B EPERM may be confused in some places.