OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / getmntent.3
index f14118c..b4f1315 100644 (file)
 .\" 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  2009-09-15 "" "Linux Programmer's Manual"
-.\"O .SH NAME
-.\"O getmntent, setmntent, addmntent, endmntent, hasmntopt,
-.\"O getmntent_r \- get file system descriptor file entry
-.SH Ì¾Á°
-getmntent, setmntent, addmntent, endmntent, hasmntopt,
-getmntent_r \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ­½Ò¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH GETMNTENT 3 2009\-09\-15 "" "Linux Programmer's Manual"
+.SH 名前
+getmntent, setmntent, addmntent, endmntent, hasmntopt, getmntent_r \-
+ファイルシステム記述ファイルのエントリを取得する
+.SH 書式
 .nf
-.B #include <stdio.h>
-.B #include <mntent.h>
+\fB#include <stdio.h>\fP
+\fB#include <mntent.h>\fP
 .sp
-.BI "FILE *setmntent(const char *" filename ", const char *" type );
+\fBFILE *setmntent(const char *\fP\fIfilename\fP\fB, const char *\fP\fItype\fP\fB);\fP
 .sp
-.BI "struct mntent *getmntent(FILE *" fp );
+\fBstruct mntent *getmntent(FILE *\fP\fIfp\fP\fB);\fP
 .sp
-.BI "int addmntent(FILE *" fp ", const struct mntent *" mnt );
+\fBint addmntent(FILE *\fP\fIfp\fP\fB, const struct mntent *\fP\fImnt\fP\fB);\fP
 .sp
-.BI "int endmntent(FILE *" fp );
+\fBint endmntent(FILE *\fP\fIfp\fP\fB);\fP
 .sp
-.BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt );
+\fBchar *hasmntopt(const struct mntent *\fP\fImnt\fP\fB, const char *\fP\fIopt\fP\fB);\fP
 .sp
-.\"O /* GNU extension */
-/* GNU ¤Ë¤è¤ë³ÈÄ¥ */
-.B #include <mntent.h>
+/* GNU による拡張 */
+\fB#include <mntent.h>\fP
 .sp
-.BI "struct mntent *getmntent_r(FILE *" fp ", struct mntent *" mntbuf ,
-.BI "                           char *" buf ", int " buflen );
+\fBstruct mntent *getmntent_r(FILE *\fP\fIfp\fP\fB, struct mntent *\fP\fImntbuf\fP\fB,\fP
+\fB                           char *\fP\fIbuf\fP\fB, int \fP\fIbuflen\fP\fB);\fP
 .fi
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
-.BR getmntent_r ():
-_BSD_SOURCE || _SVID_SOURCE
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O These routines are used to access the file system description file
-.\"O \fI/etc/fstab\fP and the mounted file system description file
-.\"O \fI/etc/mtab\fP.
-¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òµ­½Ò¤·¤¿¥Õ¥¡¥¤¥ë \fI/etc/fstab\fP
-¤È¡¢¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òµ­½Ò¤·¤¿¥Õ¥¡¥¤¥ë
-\fI/etc/mtab\fP ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£
+\fBgetmntent_r\fP(): _BSD_SOURCE || _SVID_SOURCE
+.SH 説明
+これらのルーチンは、ファイルシステムを記述したファイル \fI/etc/fstab\fP と、マウントされているファイルシステムを記述したファイル
+\fI/etc/mtab\fP にアクセスするために用いられる。
 .PP
-.\"O The
-.\"O .BR setmntent ()
-.\"O function opens the file system description file
-.\"O \fIfilename\fP and returns a file pointer which can be used by
-.\"O .BR getmntent ().
-.\"O The argument \fItype\fP is the type of access
-.\"O required and can take the same values as the \fImode\fP argument of
-.\"O .BR fopen (3).
-.BR setmntent ()
-´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfilename\fP ¤ò¥ª¡¼¥×¥ó¤·¤Æ¡¢
-¤½¤Î¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤Ï
-.BR getmntent ()
-¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¤ë¡£°ú¤­¿ô \fItype\fP ¤ÏÍ׵᤹¤ë¥¢¥¯¥»¥¹·Á¼°¤Ç¡¢
-.BR fopen (3)
-¤Î \fImode\fP °ú¤­¿ô¤ÈƱ¤¸Ãͤò¼è¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+\fBsetmntent\fP()  関数は、ファイルシステムの記述ファイル \fIfilename\fP をオープンして、
+そのファイルポインタを返す。このファイルポインタは \fBgetmntent\fP()  によって用いられる。引き数 \fItype\fP
+は要求するアクセス形式で、 \fBfopen\fP(3)  の \fImode\fP 引き数と同じ値を取ることができる。
 .PP
-.\"O The
-.\"O .BR getmntent ()
-.\"O function reads the next line from the file system
-.\"O description file \fIfp\fP and returns a pointer to a structure
-.\"O containing the broken out fields from a line in the file.
-.\"O The pointer
-.\"O points to a static area of memory which is overwritten by subsequent
-.\"O calls to
-.\"O .BR getmntent ().
-.BR getmntent ()
-´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfp\fP ¤«¤é¿·¤·¤¤¹Ô¤òÆÉ
-¤ß¹þ¤ß¡¢¹Ô¤ò¥Õ¥£¡¼¥ë¥É¤Ëʬ³ä¤·¤¿ÆâÍƤò¼ý¤á¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
-¥Ý¥¤¥ó¥¿¤Ï¥á¥â¥ê¤ÎÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤³¤ÎÎΰè¤Ï
-.BR getmntent ()
-¤ò¼¡¤Ë¸Æ¤Ó½Ð¤·¤¿¤È¤­¤Ë¾å½ñ¤­¤µ¤ì¤Æ¤·¤Þ¤¦¡£
+\fBgetmntent\fP()  関数はファイルシステムの記述ファイル \fIfp\fP から新しい行を読
+み込み、行をフィールドに分割した内容を収めた構造体へのポインタを返す。 ポインタはメモリの静的な領域を指しており、この領域は
+\fBgetmntent\fP()  を次に呼び出したときに上書きされてしまう。
 .PP
-.\"O The
-.\"O .BR addmntent ()
-.\"O function adds the
-.\"O .I mntent
-.\"O structure \fImnt\fP to
-.\"O the end of the open file \fIfp\fP.
-.BR addmntent ()
-´Ø¿ô¤Ï
-.I mntent
-¹½Â¤ÂΠ\fImnt\fP ¤ÎÆâÍƤò¡¢¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë
-\fIfp\fP ¤ÎºÇ¸å¤ËÄɲ乤롣
+\fBaddmntent\fP()  関数は \fImntent\fP 構造体 \fImnt\fP の内容を、オープンされているファイル \fIfp\fP の最後に追加する。
 .PP
-.\"O The
-.\"O .BR endmntent ()
-.\"O function closes the file system description file
-.\"O \fIfp\fP.
-.BR endmntent ()
-´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë \fIfp\fP ¤òÊĤ¸¤ë¡£
+\fBendmntent\fP()  関数はファイルシステムの記述ファイル \fIfp\fP を閉じる。
 .PP
-.\"O The
-.\"O .BR hasmntopt ()
-.\"O function scans the \fImnt_opts\fP field (see below)
-.\"O of the
-.\"O .I mntent
-.\"O structure \fImnt\fP for a substring that matches \fIopt\fP.
-.\"O See \fI<mntent.h>\fP and
-.\"O .BR mount (8)
-.\"O for valid mount options.
-.BR hasmntopt ()
-´Ø¿ô¤Ï
-.I mntent
-¹½Â¤ÂΠ\fImnt\fP ¤Î \fImnt_opts\fP ¥Õ¥£¡¼¥ë¥É (²¼µ­
-»²¾È) ¤ò¥¹¥­¥ã¥ó¤·¡¢ \fIopt\fP ¤Ë°ìÃפ¹¤ëÉôʬʸ»úÎ󤬤¢¤ë¤«¤òÄ´¤Ù¤ë¡£
-Í­¸ú¤Ê¥Þ¥¦¥ó¥È¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï \fI<mntent.h>\fP ¤È
-.BR mount (8)
-¤ò»²¾È¤Î¤³¤È¡£
+\fBhasmntopt\fP()  関数は \fImntent\fP 構造体 \fImnt\fP の \fImnt_opts\fP フィールド (下記 参照) をスキャンし、
+\fIopt\fP に一致する部分文字列があるかを調べる。 有効なマウントオプションについては \fI<mntent.h>\fP と
+\fBmount\fP(8)  を参照のこと。
 .PP
-.\"O The reentrant \fBgetmntent_r\fP() function is similar to
-.\"O .BR getmntent (),
-.\"O but stores the \fIstruct mount\fP in the provided
-.\"O .I *mntbuf
-.\"O and stores the strings pointed to by the entries in that struct
-.\"O in the provided array
-.\"O .I buf
-.\"O of size
-.\"O .IR buflen .
-¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê´Ø¿ô
-.BR getmntent_r ()
-¤Ï
-.BR getmntent ()
-¤ÈƱ¤¸¤À¤¬¡¢
-¥æ¡¼¥¶¤¬ÍÑ°Õ¤·¤¿
-.I *mntbuf
-¤Ë \fIstruct mount\fP ¤ò³ÊǼ¤·¡¢¤½¤Î¹½Â¤ÂΤγƥ¨¥ó¥È¥ê¤¬»Ø¤·¼¨¤¹Ê¸»úÎó¤ò
-¥æ¡¼¥¶¤¬ÍÑ°Õ¤·¤¿Â礭¤µ
-.I buflen
-¤ÎÇÛÎó
-.I buf
-¤Ë½ñ¤­¹þ¤à¡£
-
+リエントラントな関数 \fBgetmntent_r\fP()  は \fBgetmntent\fP()  と同じだが、 ユーザが用意した \fI*mntbuf\fP に
+\fIstruct mount\fP を格納し、その構造体の各エントリが指し示す文字列を ユーザが用意した大きさ \fIbuflen\fP の配列 \fIbuf\fP
+に書き込む。
 .PP
-.\"O The \fImntent\fP structure is defined in \fI<mntent.h>\fP as follows:
-\fImntent\fP ¹½Â¤ÂΤϠ\fI<mntent.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
+\fImntent\fP 構造体は \fI<mntent.h>\fP で以下のように定義されている。
 .sp
 .in +4n
 .nf
@@ -191,113 +102,30 @@ struct mntent {
 .fi
 .in
 
-.\"O Since fields in the mtab and fstab files are separated by whitespace,
-.\"O octal escapes are used to represent the four characters space (\e040),
-.\"O tab (\e011), newline (\e012) and backslash (\e134) in those files
-.\"O when they occur in one of the four strings in a
-.\"O .I mntent
-.\"O structure.
-.\"O The routines
-.\"O .BR addmntent ()
-.\"O and
-.\"O .BR getmntent ()
-.\"O will convert
-.\"O from string representation to escaped representation and back.
-mtab ¤ä fstab ¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Ï¶õÇò¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢
-¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¡¢²þ¹Ô¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Î 4ʸ»ú¤ò¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ç
-»È¤¤¤¿¤¤¾ì¹ç¤Ç¡¢¤«¤Ä
-.I mntent
-¹½Â¤ÂΤΠ4¤Ä¤Îʸ»úÎó¥á¥ó¥Ð¡¼¤Î¤¤¤º¤ì¤«¤ËÂбþ¤¹¤ë¥Õ¥£¡¼¥ë¥ÉÆâ¤Ç
-»È¤¤¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢8¿Ê¤Î¥¨¥¹¥±¡¼¥×ɽµ­¤ò»È¤Ã¤Æɽ¸½¤¹¤ë:
-¥¹¥Ú¡¼¥¹ (\e040), ¥¿¥Ö (\e011), ²þ¹Ô (\e012), ¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\e134)¡£
-.BR addmntent ()
-¤È
-.BR getmntent ()
-¤Ï¡¢Ê¸»úÎóɽ¸½¤«¤é
-¥¨¥¹¥±¡¼¥×ɽ¸½¤Ø¤ÎÊÑ´¹¡¢¤ª¤è¤Ó¤½¤ÎµÕ¤ò¹Ô¤¦¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O The
-.\"O .BR getmntent ()
-.\"O and
-.\"O .BR getmntent_r ()
-.\"O functions return
-.\"O a pointer to the
-.\"O .I mntent
-.\"O structure or NULL on failure.
-.BR getmntent ()
-¤È
-.BR getmntent_r ()
-¤Ï
-.I mntent
-¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
-¼ºÇÔ¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
+mtab や fstab ファイルでは、各フィールドは空白で区切られているので、 スペース、タブ、改行、バックスラッシュの 4文字をこれらのファイルで
+使いたい場合で、かつ \fImntent\fP 構造体の 4つの文字列メンバーのいずれかに対応するフィールド内で
+使いたい場合には、8進のエスケープ表記を使って表現する: スペース (\e040), タブ (\e011), 改行 (\e012), バックスラッシュ
+(\e134)。 \fBaddmntent\fP()  と \fBgetmntent\fP()  は、文字列表現から エスケープ表現への変換、およびその逆を行う。
+.SH 返り値
+\fBgetmntent\fP()  と \fBgetmntent_r\fP()  は \fImntent\fP 構造体へのポインタを返す。 失敗した場合は NULL
+を返す。
 .PP
-.\"O The
-.\"O .BR addmntent ()
-.\"O function returns 0 on success and 1 on failure.
-.\Baddmntent\fP() ´Ø¿ô¤ÏÀ®¸ù¤·¤¿¤é 0 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¤é 1 ¤òÊÖ¤¹¡£
+\fBaddmntent\fP()  関数は成功したら 0 を返し、失敗したら 1 を返す。
 .PP
-.\"O The
-.\"O .BR endmntent ()
-.\"O function always returns 1.
-.BR endmntent ()
-´Ø¿ô¤Ï¤Ä¤Í¤Ë 1 ¤òÊÖ¤¹¡£
+\fBendmntent\fP()  関数はつねに 1 を返す。
 .PP
-.\"O The
-.\"O .BR hasmntopt ()
-.\"O function returns the address of the substring if
-.\"O a match is found and NULL otherwise.
-.BR hasmntopt ()
-´Ø¿ô¤Ï¡¢¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¤ÏÉôʬʸ»úÎó¤Ø¤Î¥¢¥É¥ì¥¹¤òÊÖ¤·¡¢
-¥Þ¥Ã¥Á¤·¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£
-.\"O .SH FILES
-.SH ¥Õ¥¡¥¤¥ë
+\fBhasmntopt\fP()  関数は、マッチした場合は部分文字列へのアドレスを返し、 マッチしなければ NULL を返す。
+.SH ファイル
 .nf
-.\"O /etc/fstab          file system description file
-.\"O /etc/mtab           mounted file system description file
-/etc/fstab          ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àµ­½Ò¥Õ¥¡¥¤¥ë
-/etc/mtab           ¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îµ­½Ò¥Õ¥¡¥¤¥ë
+/etc/fstab          ファイルシステム記述ファイル
+/etc/mtab           マウントされたファイルシステムの記述ファイル
 .fi
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O The nonreentrant functions are from SunOS 4.1.3.
-.\"O A routine
-.\"O .BR getmntent_r ()
-.\"O was introduced in HP-UX 10, but it returns an int.
-.\"O The prototype shown above is glibc-only.
-¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤Ï SunOS 4.1.3 Í³Íè¤Î¤â¤Î¤Ç¤¢¤ë¡£
-.BR getmntent_r ()
-´Ø¿ô¤Ï HPUX 10 ¤ÇƳÆþ¤µ¤ì¤¿¤¬¡¢¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï int ¤òÊÖ¤¹¡£
-¾åµ­¤Ë¼¨¤·¤¿¥×¥í¥È¥¿¥¤¥×¤Ï glibc Æȼ«¤Î¤â¤Î¤Ç¤¢¤ë¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O System V also has a
-.\"O .BR getmntent ()
-.\"O function but the calling sequence
-.\"O differs, and the returned structure is different.
-.\"O Under System V
-.\"O .I /etc/mnttab
-.\"O is used.
-System V ¤Ë¤â
-.BR getmntent ()
-´Ø¿ô¤Ï¤¢¤ë¤¬¡¢
-¸Æ¤Ó½Ð¤·¼ê½ç¤¬°Û¤Ê¤ê¡¢ÊÖ¤µ¤ì¤ë¹½Â¤ÂΤâ°Û¤Ê¤ë¡£
-System V ¤Ç¤Ï
-.I /etc/mnttab
-¤¬ÍѤ¤¤é¤ì¤ë¡£
-.\"O 4.4BSD and Digital Unix have a routine
-.\"O .BR getmntinfo (),
-.\"O a wrapper around the system call
-.\"O .BR getfsstat ().
-4.4BSD ¤È Digital Unix ¤Ë¤Ï
-.BR getmntinfo ()
-¤¬¤¢¤ë¤¬¡¢
-¥·¥¹¥Æ¥à¥³¡¼¥ë
-.BR getfsstat ()
-¤Î¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¤¢¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR fopen (3),
-.BR fstab (5),
-.BR mount (8)
+.SH 準拠
+リエントラントでない関数は SunOS 4.1.3 由来のものである。 \fBgetmntent_r\fP()  関数は HPUX 10
+で導入されたが、このバージョンでは int を返す。 上記に示したプロトタイプは glibc 独自のものである。
+.SH 注意
+System V にも \fBgetmntent\fP()  関数はあるが、 呼び出し手順が異なり、返される構造体も異なる。 System V では
+\fI/etc/mnttab\fP が用いられる。 4.4BSD と Digital UNIX には \fBgetmntinfo\fP()  があるが、
+システムコール \fBgetfsstat\fP()  のラッパー関数である。
+.SH 関連項目
+\fBfopen\fP(3), \fBfstab\fP(5), \fBmount\fP(8)