mnttab - mounted file system table
The file /etc/mnttab is really a file system that provides read-only access to the table of mounted file systems for the current host. /etc/mnttab is read by programs using the routines described in getmntent(3C). Mounting a file system adds an entry to this table. Unmounting removes an entry from this table. Remounting a file system causes the information in the mounted file system table to be updated to reflect any changes caused by the remount. The list is maintained by the kernel in order of mount time. That is, the first mounted file system is first in the list and the most recently mounted file system is last. When mounted on a mount point the file system appears as a regular file containing the current mnttab information.
Each entry is a line of fields separated by TABs in the form:
special mount_point fstype options time
where:
special
mount_point
fstype
options
time
Examples of entries for the special field include the pathname of a block-special device, the name of a remote file system in the form of host:pathname, or the name of a swap file, for example, a file made with mkfile(1M).
The following ioctl(2) calls are supported:
MNTIOC_NMNTS
MNTIOC_GETDEVLIST
MNTIOC_SETTAG
uint_t mtd_major; /* major number for mounted fs */ uint_t mtd_minor; /* minor number for mounted fs */ char *mtd_mntpt; /* mount point of file system */ char *mtd_tag; /* tag to set/clear */
If the tag already exists then it is marked as set but not re-added. Tags can be at most MAX_MNTOPT_TAG long.
Use of this ioctl is restricted to processes with the {PRIV_SYS_MOUNT} privilege.
MNTIOC_CLRTAG
Use of this ioctl is restricted to processes with the {PRIV_SYS_MOUNT} privilege.
EFAULT
EINVAL
ENAMETOOLONG
EPERM
/etc/mnttab
/usr/include/sys/mntio.h
mkfile(1M), mount_cachefs(1M), mount_hsfs(1M), mount_nfs(1M), mount_pcfs(1M), mount_ufs(1M), mount(1M), ioctl(2), read(2), poll(2), stat(2), getmntent(3C)
The mnttab file system provides the previously undocumented dev=xxx option in the option string for each mounted file system. This is provided for legacy applications that might have been using the dev=information option.
Using dev=option in applications is strongly discouraged. The device number string represents a 32-bit quantity and might not contain correct information in 64-bit environments.
Applications requiring device number information for mounted file systems should use the getextmntent(3C) interface, which functions properly in either 32- or 64-bit environments.
The snapshot of the mnttab information is taken any time a read(2) is performed at offset 0 (the beginning) of the mnttab file. The file modification time returned by stat(2) for the mnttab file is the time of the last change to mounted file system information. A poll(2) system call requesting a POLLRDBAND event can be used to block and wait for the system's mounted file system information to be different from the most recent snapshot since the mnttab file was opened.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |