Penguin
Annotated edit history of mount(2) version 3, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
2 mount, umount - mount and unmount filesystems.
3 !!SYNOPSIS
2 PerryLorier 4 __#include <sys/mount.h>__
1 perry 5
2 PerryLorier 6 __int mount(const char *__''specialfile''__, const char *__ ''dir'' __, const char *__ ''filesystemtype''__, unsigned long__ ''mountflags'' __, const void *__ ''data''__);__
1 perry 7
2 PerryLorier 8 __int umount(const char *__''dir''__);__
1 perry 9 !!DESCRIPTION
2 PerryLorier 10 __mount__ attaches the filesystem specified by ''specialfile'' (which is often a device name) to the directory specified by ''dir''.
1 perry 11
2 PerryLorier 12 __umount__ removes the attachment of the (topmost) filesystem mounted on ''dir''.
1 perry 13
2 PerryLorier 14 Only the super-user may mount and unmount filesystems.
1 perry 15
2 PerryLorier 16 The ''filesystemtype'' argument may take one of the values listed in /proc/filesystems (like "minix", "ext2", "msdos", "proc", "nfs", "iso9660" etc.).
1 perry 17
2 PerryLorier 18 The ''mountflags'' argument may have the magic number 0xC0ED in the top 16 bits, and various mount flags (as defined in <linux/fs.h> for libc4 and libc5 and in <sys/mount.h> for glibc2) in the low order 16 bits:
1 perry 19
2 PerryLorier 20 #define MS_RDONLY 1 /* mount read-only */
21 #define MS_NOSUID 2 /* ignore suid and sgid bits */
22 #define MS_NODEV 4 /* no access to device special files */
23 #define MS_NOEXEC 8 /* no program execution */
24 #define MS_SYNCHRONOUS 16 /* writes are synced at once */
25 #define MS_REMOUNT 32 /* alter flags of a mounted fs */
26 #define MS_MANDLOCK 64 /* allow mandatory locks */
27 #define MS_NOATIME 1024 /* do not update access times */
28 #define MS_NODIRATIME 2048 /* do not update dir access times */
29 #define MS_BIND 4096 /* bind subtree elsewhere */
1 perry 30
31 The ''data'' argument is interpreted by the different file systems.
32 !!RETURN VALUE
2 PerryLorier 33 On success, zero is returned. On error, -1 is returned, and ''errno'' is set appropriately.
1 perry 34 !!ERRORS
2 PerryLorier 35 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.
1 perry 36
2 PerryLorier 37 ;[EPERM]: The user is not the super-user.
38 ;[ENODEV]: ''Filesystemtype'' not configured in the kernel.
39 ;[ENOTBLK]: ''Specialfile'' is not a block device (if a device was required).
3 PerryLorier 40 ;[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.).
2 PerryLorier 41 ;[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.
42 ;[EFAULT]: One of the pointer arguments points outside the user address space.
43 ;[ENOMEM]: The kernel could not allocate a free page to copy filenames or data into.
44 ;[ENAMETOOLONG]: A pathname was longer than MAXPATHLEN.
45 ;[ENOENT]: A pathname was empty or had a nonexistent component.
46 ;[ENOTDIR]: The second argument, or a prefix of the first argument, is not a directory.
47 ;[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.
48 ;[ENXIO]: The major number of the block device ''specialfile'' is out of range.
49 ;[EMFILE]: (In case no block device is required:) Table of dummy devices is full.
1 perry 50
51 !!CONFORMING TO
2 PerryLorier 52 These functions are Linux-specific and should not be used in programs intended to be portable.
1 perry 53
54 !!HISTORY
2 PerryLorier 55 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
56 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
57 ''umount(dir)'' (since now devices can be mounted in more than one place, so specifying the device does not suffice).
1 perry 58
2 PerryLorier 59 The original MS_SYNC flag was renamed MS_SYNCHRONOUS in 1.1.69 when a different MS_SYNC was added to
1 perry 60
61 !!SEE ALSO
62 mount(8), umount(8)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 8 times)