1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Inspired by a page written by Walter Harms.
25 .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
26 .\" Translated Wed 7 Aug 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
28 .TH GETFSENT 3 2002-02-28 "Linux" "Linux Programmer's Manual"
30 .\"O getfsent, getfsspec, getfsfile, setfsent, endfsent \- handle fstab entries
32 getfsent, getfsspec, getfsfile, setfsent, endfsent \- fstab ¥¨¥ó¥È¥ê¤Î½èÍý
37 .B "void endfsent(void);"
39 .B "struct fstab *getfsent(void);"
41 .BI "struct fstab *getfsfile(const char *" mount_point );
43 .BI "struct fstab *getfsspec(const char *" special_file );
45 .B "int setfsent(void);"
48 .\"O These functions read from the file
50 .\"O The \fIstruct fstab\fP is defined by:
53 ¥Õ¥¡¥¤¥ë¤«¤é¾ðÊó¤òÆɤ߹þ¤à¡£\fIfstab\fP ¹½Â¤ÂΤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
58 char *fs_spec; /* block device name */
59 char *fs_file; /* mount point */
60 char *fs_vfstype; /* file-system type */
61 char *fs_mntops; /* mount options */
62 const char *fs_type; /* rw/rq/ro/sw/xx option */
63 int fs_freq; /* dump frequency, in days */
64 int fs_passno; /* pass number on parallel dump */
71 .\"O contains (on a *BSD system)
72 .\"O one of the five strings "rw", "rq", "ro", "sw", "xx"
73 .\"O (read-write, read-write with quota, read-only, swap, ignore).
76 ¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢5 ¤Ä¤Îʸ»úÎó
77 "rw", "rq", "ro", "sw", "xx"
79 (¤½¤ì¤¾¤ì read-write, quota ÉÕ¤ read-write, read-only, swap, ignore)¡£
83 .\"O opens the file when required and positions it at the first line.
86 ¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢
91 .\"O parses the next line from the file.
92 .\"O (After opening it when required.)
95 ¤Ï fstab ¥Õ¥¡¥¤¥ë¤«¤é¼¡¤Î¹Ô¤ò¥Ñ¡¼¥¹¤¹¤ë
96 (ɬÍפʾì¹ç¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë)¡£
100 .\"O closes the file when required.
103 ¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
106 .\"O .BR getfsspec ()
107 .\"O searches the file from the start and returns the first entry found
110 .\"O field matches the
115 ¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢
119 °ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£
122 .\"O .BR getfsfile ()
123 .\"O searches the file from the start and returns the first entry found
126 .\"O field matches the
131 ¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢
135 °ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£
136 .\"O .SH "RETURN VALUE"
138 .\"O Upon success, the functions
139 .\"O .BR getfsent (),
140 .\"O .BR getfsfile (),
142 .\"O .BR getfsspec ()
143 .\"O return a pointer to a \fIstruct fstab\fP, while
146 .\"O Upon failure or end-of-file, these functions return NULL and 0, respectively.
151 ¤Î³Æ´Ø¿ô¤Ï \fIfstab\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¡¢
154 ¼ºÇÔ¤¹¤ë¤È¤³¤ì¤é¤Î´Ø¿ô¤Ï NULL ¤òÊÖ¤·¡¢
155 end-of-file ¤Ë¤Ê¤Ã¤¿¤é 0 ¤òÊÖ¤¹¡£
159 .\"O .\" .BR getfsent ()
160 .\"O .\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD.
162 .\" ´Ø¿ô¤Ï 4.0BSD ¤ÇÅо줷¤¿¡£
163 .\" ¾¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¤¿¡£
164 .\"O .SH "CONFORMING TO"
166 .\"O These functions are not in POSIX.1-2001.
167 .\"O Several operating systems have them,
168 .\"O e.g., *BSD, SunOS, Digital UNIX, AIX (which also has a
169 .\"O .BR getfstype ()).
170 .\"O HP-UX has functions of the same names,
171 .\"O that however use a \fIstruct checklist\fP
172 .\"O instead of a \fIstruct fstab\fP,
173 .\"O and calls these functions obsolete, superseded by
174 .\"O .BR getmntent (3).
175 POSIX.1-2001 ¤Ë¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï¸ºß¤·¤Ê¤¤¡£
176 ¤³¤ì¤é¤Î´Ø¿ô¤ò¤â¤Ä OS ¤Ï¤¤¤¯¤Ä¤«¤¢¤ê¡¢
177 *BSD, SunOS, Digital UNIX, AIX Åù¤Ç¤¢¤ë
181 HP-UX ¤Ë¤âƱ̾¤Î´Ø¿ô·²¤¬¤¢¤ë¤¬¡¢
182 HP-UX ¤Î¤â¤Î¤Ï \fIfstab\fP ¹½Â¤ÂΤǤϤʤ¯ \fIchecklist\fP ¹½Â¤ÂΤòÍѤ¤¤ë¡£
183 ¤Þ¤¿¤³¤ì¤é¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ï obsolete ¤Ç¡¢
185 ¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤Æ¤¤¤ë¡£
188 .\"O These functions are not thread-safe.
189 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£
191 .\"O Since Linux allows mounting a block special device in several places,
192 .\"O and since several devices can have the same mount point, where the
193 .\"O last device with a given mount point is the interesting one,
195 .\"O .BR getfsfile ()
197 .\"O .BR getfsspec ()
198 .\"O only return the first occurrence, these two functions are not suitable
199 .\"O for use under Linux.
200 Linux ¤Ç¤Ï¥Ö¥í¥Ã¥¯¥¹¥Ú¥·¥ã¥ë¥Ç¥Ð¥¤¥¹¤òÊ£¿ô¤Î¾ì½ê¤Ë¥Þ¥¦¥ó¥È¤Ç¤¡¢
201 ¤Þ¤¿Ê£¿ô¤Î¥Ç¥Ð¥¤¥¹¤¬Æ±¤¸¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò¶¦Í¤Ç¤¤ë
202 (¤³¤Î¾ì¹ç¤Ï¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËºÇ¸å¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤¬°ÕÌ£¤ò»ý¤Ä)
207 ¤Ï¥Þ¥Ã¥Á¤·¤¿ºÇ½é¤Î¥¨¥ó¥È¥ê¤·¤«ÊÖ¤µ¤Ê¤¤¤Î¤Ç¡¢
208 ¤³¤ì¤é¤Î 2 ¤Ä¤Î´Ø¿ô¤Ï Linux ¤Ç¤ÎÍøÍѤˤÏŬ¤·¤Æ¤¤¤Ê¤¤¡£