Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
umount(2)
Edit
PageHistory
Diff
Info
LikePages
MOUNT !!!MOUNT NAME SYNOPSIS DESCRIPTION RETURN VALUE ERRORS CONFORMING TO HISTORY SEE ALSO ---- !!NAME mount, umount - mount and unmount filesystems. !!SYNOPSIS __#include __ __int mount(const char *__''specialfile''__, const char *__ ''dir'' __, const char *__ ''filesystemtype''__, unsigned long__ ''mountflags'' __, const void *__ ''data''__);__ __int umount(const char *__''dir''__);__ !!DESCRIPTION __mount__ attaches the filesystem specified by ''specialfile'' (which is often a device name) to the directory specified by ''dir''. __umount__ removes the attachment of the (topmost) filesystem mounted on ''dir''. Only the super-user may mount and unmount filesystems. The ''filesystemtype'' argument may take one of the values listed in /proc/filesystems (like '' The ''mountflags'' argument may have the magic number 0xC0ED in the top 16 bits, and various mount flags (as defined in '' #define MS_RDONLY 1 /* mount read-only */ #define MS_NOSUID 2 /* ignore suid and sgid bits */ #define MS_NODEV 4 /* no access to device special files */ #define MS_NOEXEC 8 /* no program execution */ #define MS_SYNCHRONOUS 16 /* writes are synced at once */ #define MS_REMOUNT 32 /* alter flags of a mounted fs */ #define MS_MANDLOCK 64 /* allow mandatory locks */ #define MS_NOATIME 1024 /* do not update access times */ #define MS_NODIRATIME 2048 /* do not update dir access times */ #define MS_BIND 4096 /* bind subtree elsewhere */ The ''data'' argument is interpreted by the different file systems. !!RETURN VALUE On success, zero is returned. On error, -1 is returned, and ''errno'' is set appropriately. !!ERRORS The error values given below result from filesystem type independent errors. Each filesystem type may have its own special errors and its own special behavior. See the kernel source code for details. __EPERM__ The user is not the super-user. __ENODEV__ ''Filesystemtype'' not configured in the kernel. __ENOTBLK__ ''Specialfile'' is not a block device (if a device was required). __EBUSY__ ''Specialfile'' is already mounted. Or, it cannot be remounted read-only, because it still holds files open for writing. Or, it cannot be mounted on ''dir'' because ''dir'' is still busy (it is the working directory of some task, the mount point of another device, has open files, etc.). __EINVAL__ ''Specialfile'' had an invalid superblock. Or, a remount was attempted, while ''specialfile'' was not already mounted on ''dir''. Or, an umount was attempted, while ''dir'' was not a mount point. __EFAULT__ One of the pointer arguments points outside the user address space. __ENOMEM__ The kernel could not allocate a free page to copy filenames or data into. __ENAMETOOLONG__ A pathname was longer than MAXPATHLEN. __ENOENT__ A pathname was empty or had a nonexistent component. __ENOTDIR__ The second argument, or a prefix of the first argument, is not a directory. __EACCES__ A component of a path was not searchable. Or, mounting a read-only filesystem was attempted without giving the MS_RDONLY flag. Or, the block device ''Specialfile'' is located on a filesystem mounted with the MS_NODEV option. __ENXIO__ The major number of the block device ''specialfile'' is out of range. __EMFILE__ (In case no block device is required:) Table of dummy devices is full. !!CONFORMING TO These functions are Linux-specific and should not be used in programs intended to be portable. !!HISTORY The original __umount__ function was called as ''umount(device)'' and would return ENOTBLK when called with something other than a block device. In Linux 0.98p4 a call ''umount(dir)'' was added, in order to support anonymous devices. In Linux 2.3.99-pre7 the call ''umount(device)'' was removed, leaving only ''umount(dir)'' (since now devices can be mounted in more than one place, so specifying the device does not suffice). The original MS_SYNC flag was renamed MS_SYNCHRONOUS in 1.1.69 when a different MS_SYNC was added to !!SEE ALSO mount(8), umount(8) ----
5 pages link to
umount(2)
:
eject(1)
Man2u
syscalls(2)
umount(8)
mount(8)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.