nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man4 / mnttab.4
blob23c03942f8d7733831b4c3b28c5f3ab277270409
1 '\" te
2 .\" Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
4 .\" Copyright 1989 AT&T
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH MNTTAB 4 "Sep 8, 2015"
9 .SH NAME
10 mnttab \- mounted file system table
11 .SH DESCRIPTION
12 .LP
13 The file \fB/etc/mnttab\fR is really a file system that provides read-only
14 access to the table of mounted file systems for the current host.
15 \fB/etc/mnttab\fR is read by programs using the routines described in
16 \fBgetmntent\fR(3C). Mounting a file system adds an entry to this table.
17 Unmounting removes an entry from this table. Remounting a file system causes
18 the information in the mounted file system table to be updated to reflect any
19 changes caused by the remount. The list is maintained by the kernel in order of
20 mount time. That is, the first mounted file system is first in the list and the
21 most recently mounted file system is last. When mounted on a mount point the
22 file system appears as a regular file containing the current \fBmnttab\fR
23 information.
24 .LP
25 Each entry is a line of fields separated by TABs in the form:
26 .sp
27 .in +2
28 .nf
29 \fIspecial   mount_point   fstype   options   time\fR
30 .fi
31 .in -2
33 .LP
34 where:
35 .sp
36 .ne 2
37 .na
38 \fB\fIspecial\fR\fR
39 .ad
40 .RS 15n
41 The name of the resource that has been mounted.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fImount_point\fR\fR
48 .ad
49 .RS 15n
50 The pathname of the directory on which the filesystem is mounted.
51 .RE
53 .sp
54 .ne 2
55 .na
56 \fB\fIfstype\fR\fR
57 .ad
58 .RS 15n
59 The file system type of the mounted file system.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fB\fIoptions\fR\fR
66 .ad
67 .RS 15n
68 The mount options. See respective mount file system man page in the See Also
69 section below.
70 .RE
72 .sp
73 .ne 2
74 .na
75 \fB\fItime\fR\fR
76 .ad
77 .RS 15n
78 The time at which the file system was mounted.
79 .RE
81 .LP
82 Examples of entries for the \fIspecial\fR field include the pathname of a
83 block-special device, the name of a remote file system in the form of
84 \fIhost:pathname\fR, or the name of a \fBswap file\fR, for example, a file made
85 with \fBmkfile\fR(8).
86 .SH IOCTLS
87 .LP
88 The following \fBioctl\fR(2) calls are supported:
89 .sp
90 .ne 2
91 .na
92 \fB\fBMNTIOC_NMNTS\fR\fR
93 .ad
94 .RS 21n
95 Returns the count of mounted resources in the current snapshot in the
96 \fBuint32_t\fR pointed to by \fIarg\fR.
97 .RE
99 .sp
100 .ne 2
102 \fB\fBMNTIOC_GETDEVLIST\fR\fR
104 .RS 21n
105 Returns an array of \fBuint32_t\fR's that is twice as long as the length
106 returned by \fBMNTIOC_NMNTS\fR. Each pair of numbers is the major and minor
107 device number for the file system at the corresponding  line in the current
108 \fB/etc/mnttab\fR snapshot. \fIarg\fR points to the memory buffer to receive
109 the device number information.
113 .ne 2
115 \fB\fBMNTIOC_SETTAG\fR\fR
117 .RS 21n
118 Sets a tag word into the options list for a mounted file system. A tag is a
119 notation that will appear in the options string of a mounted file system but it
120 is not recognized or interpreted by the file system code. \fIarg\fR points to a
121 filled in \fBmnttagdesc\fR structure, as shown in the following example:
123 .in +2
125 uint_t  mtd_major;  /* major number for mounted fs */
126 uint_t  mtd_minor;  /* minor number for mounted fs */
127 char    *mtd_mntpt; /* mount point of file system */
128 char    *mtd_tag;   /* tag to set/clear */
130 .in -2
132 If the tag already exists then it is marked as set but not re-added. Tags can
133 be at most \fBMAX_MNTOPT_TAG\fR long.
135 Use of this ioctl is restricted to processes with the \fB{PRIV_SYS_MOUNT}\fR
136 privilege.
140 .ne 2
142 \fB\fBMNTIOC_CLRTAG\fR\fR
144 .RS 21n
145 Marks a tag in the options list for a mounted file system as not set. \fIarg\fR
146 points to the same structure as \fBMNTIOC_SETTAG\fR, which identifies the file
147 system and tag to be cleared.
149 Use of this ioctl is restricted to processes with the \fB{PRIV_SYS_MOUNT}\fR
150 privilege.
153 .SH ERRORS
154 .ne 2
156 \fB\fBEFAULT\fR\fR
158 .RS 16n
159 The arg pointer in an \fBMNTIOC_ ioctl\fR call pointed to an inaccessible
160 memory location or a character pointer in a \fBmnttagdesc\fR structure pointed
161 to an inaccessible memory location.
165 .ne 2
167 \fB\fBEINVAL\fR\fR
169 .RS 16n
170 The tag specified in a \fBMNTIOC_SETTAG\fR call already exists as a file system
171 option, or the tag specified in a \fBMNTIOC_CLRTAG\fR call does not exist.
175 .ne 2
177 \fB\fBENAMETOOLONG\fR\fR
179 .RS 16n
180 The tag specified in a \fBMNTIOC_SETTAG\fR call is too long or the tag would
181 make the total length of the option string for the mounted file system too
182 long.
186 .ne 2
188 \fB\fBEPERM\fR\fR
190 .RS 16n
191 The calling process does not have \fB{PRIV_SYS_MOUNT}\fR privilege and either a
192 \fBMNTIOC_SETTAG\fR or \fBMNTIOC_CLRTAG\fR call was made.
195 .SH FILES
196 .ne 2
198 \fB\fB/etc/mnttab\fR\fR
200 .RS 28n
201 Usual mount point for \fBmnttab\fR file system
205 .ne 2
207 \fB\fB/usr/include/sys/mntio.h\fR\fR
209 .RS 28n
210 Header file that contains \fBIOCTL\fR definitions
213 .SH SEE ALSO
215 \fBmkfile\fR(8), \fBmount_hsfs\fR(8), \fBmount_nfs\fR(8),
216 \fBmount_pcfs\fR(8), \fBmount_ufs\fR(8), \fBmount\fR(8),
217 \fBioctl\fR(2), \fBread\fR(2), \fBpoll\fR(2), \fBstat\fR(2),
218 \fBgetmntent\fR(3C)
219 .SH WARNINGS
221 The \fBmnttab\fR file system provides the previously undocumented
222 \fBdev=\fR\fIxxx\fR option in the option string for each mounted file system.
223 This is provided for legacy applications that might have been using the
224 \fBdev=information\fR option.
226 Using \fBdev=\fR\fIoption\fR in applications is strongly discouraged. The
227 device number string represents a 32-bit quantity and might not contain correct
228 information in 64-bit environments.
230 Applications requiring device number information for mounted file systems
231 should use the \fBgetextmntent\fR(3C) interface, which functions properly in
232 either 32- or 64-bit environments.
233 .SH NOTES
235 The snapshot of the \fBmnttab\fR information is taken any time a \fBread\fR(2)
236 is performed at offset \fB0\fR (the beginning) of the \fBmnttab\fR file. The
237 file modification time returned by \fBstat\fR(2) for the \fBmnttab\fR file is
238 the time of the last change to mounted file system information. A \fBpoll\fR(2)
239 system call requesting a \fBPOLLRDBAND\fR event can be used to block and wait
240 for the system's mounted file system information to be different from the most
241 recent snapshot since the \fBmnttab\fR file was opened.