[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    umount(2) manual page Table of Contents

Name

umount - unmount a file system

Synopsis

#include <sys/mount.h>

int umount(const char *file);

Description

umount() requests that a previously mounted file system contained on the block special device or directory identified by file be unmounted. file is a pointer to a path name. After unmounting the file system, the directory upon which the file system was mounted reverts to its ordinary interpretation.

umount() may be invoked only by the super-user.

Return 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.

Errors

umount() will fail if one or more of the following are true:

EBUSY
A file on file is busy.
EFAULT
file points to an illegal address.
EINVAL
file is not mounted.
ENOENT
file does not exist.
ELOOP
Too many symbolic links were encountered in translating the path pointed to by file.
EMULTIHOP
Components of the path pointed to by file require hopping to multiple remote machines.
ENAMETOOLONG
The length of the file argument exceeds {PATH_MAX }, or the length of a file component exceeds {NAME_MAX } while {_POSIX_NO_TRUNC } is in effect.
ENOLINK
file is on a remote machine, and the link to that machine is no longer active.
ENOTBLK
file is not a block special device.
EPERM
The process’s effective user ID is not super-user.
EREMOTE
file is remote.

See Also

mount(2)


Table of Contents