File: getmntent.3

package info (click to toggle)
manpages-ja 0.5.0.0.20061115-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 19,788 kB
  • ctags: 4
  • sloc: sh: 13,215; perl: 157; makefile: 117
file content (166 lines) | stat: -rw-r--r-- 5,839 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\"     Linux libc source code
.\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\"     386BSD man pages
.\" Modified Sat Jul 24 21:46:57 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified 961109, 031115, aeb
.\"
.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
.\" Translated 1998-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\" Updated 2000-09-03, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2005-03-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
.TH GETMNTENT 3  2003-11-15 "" "Linux Programmer's Manual"
.SH ̾
getmntent, setmntent, addmntent, endmntent, hasmntopt,
getmntent_r \- ե륷ƥ൭ҥեΥȥ
.nf
.B #include <stdio.h>
.B #include <mntent.h>
.sp
.BI "FILE *setmntent(const char *" filename ", const char *" type );
.sp
.BI "struct mntent *getmntent(FILE *" fp );
.sp
.BI "int addmntent(FILE *" fp ", const struct mntent *" mnt );
.sp
.BI "int endmntent(FILE *" fp );
.sp
.BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt );
.sp
/* GNU ˤĥ */
.BR "#define _GNU_SOURCE" "    /*  _SVID_SOURCE  _BSD_SOURCE */"
.B #include <mntent.h>
.sp
.BI "struct mntent *getmntent_r(FILE *" fp ", struct mntent *" mntbuf ,
.BI "                           char *" buf ", int " buflen );
.fi
.SH 
Υ롼ϡե륷ƥ򵭽Ҥե \fI/etc/fstab\fP 
ȡޥȤƤե륷ƥ򵭽Ҥե 
\fI/etc/mtab\fP ˥뤿Ѥ롣
.PP
.BR setmntent ()
ؿϡե륷ƥεҥե \fIfp\fP 򥪡ץ󤷤ơ
Υեݥ󥿤֤Υեݥ󥿤
.BR getmntent ()
ˤäѤ롣 \fItype\fP ׵᤹륢ǡ
.BR fopen (3)
 \fImode\fP Ʊͤ뤳ȤǤ롣
.PP
.BR getmntent ()
ؿϥե륷ƥεҥե \fIfp\fP 鿷Ԥ
߹ߡԤեɤʬ䤷Ƥ᤿¤ΤؤΥݥ󥿤֤
ݥ󥿤ϥŪΰؤƤꡢΰ 
\fBgetmntent\fP() 򼡤˸ƤӽФȤ˾񤭤Ƥޤ
.PP
.BR addmntent ()
ؿ mntent ¤ \fImnt\fP Ƥ򡢥ץ󤵤Ƥե 
\fIfp\fP κǸɲä롣
.PP
.BR endmntent ()
ؿϥե륷ƥεҥե \fIfp\fP Ĥ롣
.PP
.BR hasmntopt ()
ؿ mntent ¤ \fImnt\fP  \fImnt_opts\fP ե (
) 򥹥󤷡 \fIopt\fP ˰פʬʸ󤬤뤫Ĵ٤롣
ͭʥޥȥץˤĤƤ \fI<mntent.h>\fP 
.BR mount (8)
򻲾ȤΤȡ
.PP
ꥨȥȤʴؿ \fBgetmntent_r\fP()  \fBgetmntent\fP() Ʊ
桼Ѱդ
.RI * mntbuf
 mount ¤ΤǼι¤Τγƥȥ꤬ؤʸ
桼Ѱդ礭
.I buflen

.I buf
˽񤭹ࡣ

.PP
\fImntent\fP ¤Τ \fI<mntent.h>\fP ǰʲΤ褦Ƥ롣
.sp
.RS
.nf
.ne 8
.ta 8n 16n 32n
struct mntent {
	char 	*mnt_fsname;		/* name of mounted file system */
	char	*mnt_dir;		/* file system path prefix */
	char	*mnt_type;		/* mount type (see mntent.h) */
	char	*mnt_opts;		/* mount options (see mntent.h) */
	int	mnt_freq;		/* dump frequency in days */
	int	mnt_passno;		/* pass number on parallel fsck */
};
.ta
.fi
.RE

mtab  fstab եǤϡƥեɤ϶ǶڤƤΤǡ
ڡ֡ԡХåå 4ʸ򤳤Υե
Ȥǡ mntent ¤Τ 4ĤʸС
줫бեǻȤˤϡ
8ʤΥɽȤäɽ:
ڡ (\e040),  (\e011),  (\e012), Хåå (\e134)
\fBaddmntent\fP()  \fBgetmntent\fP() ϡʸɽ
ɽؤѴӤεդԤ
.SH ֤
\fBgetmntent\fP()  \fBgetmntent_r\fP()  mntent ¤ΤؤΥݥ󥿤֤
Ԥ NULL ֤
.PP
.\Baddmntent\fP() ؿ 0 ֤Ԥ 1 ֤
.PP
\fBendmntent\fP() ؿϤĤͤ 1 ֤
.PP
\fBhasmntopt\fP() ؿϡޥåʬʸؤΥɥ쥹֤
ޥåʤ NULL ֤
.SH ե
.nf
/etc/fstab          ե륷ƥ൭ҥե
/etc/mtab           ޥȤ줿ե륷ƥεҥե
.fi
.SH 
ꥨȥȤǤʤؿ SunOS 4.1.3 ͳΤΤǤ롣
.BR getmntent_r ()
ؿ HPUX 10 Ƴ줿ΥСǤ int ֤
嵭˼ץȥפ glibc ȼΤΤǤ롣
LSB Ǥϡؿ
.BR endhostent (),
.BR sethostent (),
.BR setmntent ()
侩Ǥ롣
.SH 
System V ˤ \fBgetmntent\fP() ؿϤ뤬
ƤӽФ礬ۤʤꡢ֤빽¤Τۤʤ롣
System V Ǥ
.I /etc/mnttab
Ѥ롣
4.4BSD  Digital Unix ˤ \fBgetmntinfo\fP() 뤬
ƥॳ \fBgetfsstat\fP() ΥåѡؿǤ롣
.SH Ϣ
.BR fopen (3),
.BR fstab (5),
.BR mount (8)