.\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl) .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" Inspired by a page written by Walter Harms. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved. .\" Translated Wed 7 Aug 2002 by NAKANO Takeo .\" .TH GETFSENT 3 2017\-09\-15 Linux "Linux Programmer's Manual" .SH 名前 getfsent, getfsspec, getfsfile, setfsent, endfsent \- fstab エントリーの処理 .SH 書式 \fB#include \fP .PP \fBvoid endfsent(void);\fP .PP \fBstruct fstab *getfsent(void);\fP .PP \fBstruct fstab *getfsfile(const char *\fP\fImount_point\fP\fB);\fP .PP \fBstruct fstab *getfsspec(const char *\fP\fIspecial_file\fP\fB);\fP .PP \fBint setfsent(void);\fP .SH 説明 これらの関数は \fI/etc/fstab\fP ファイルから情報を読み込む。\fIfstab\fP 構造体は次のように定義されている。 .PP .in +4n .EX struct fstab { char *fs_spec; /* block device name */ char *fs_file; /* mount point */ char *fs_vfstype; /* file\-system type */ char *fs_mntops; /* mount options */ const char *fs_type; /* rw/rq/ro/sw/xx option */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; .EE .in .PP *BSD システムの場合、 \fIfs_type\fP フィールドには、5 つの文字列 "rw", "rq", "ro", "sw", "xx" のいずれかが入る (それぞれ read\-write, quota 付き read\-write, read\-only, swap, ignore)。 .PP 関数 \fBsetfsent\fP() は呼び出されると fstab ファイルをオープンし、 最初の行に移動する。 .PP 関数 \fBgetfsent\fP() は fstab ファイルから次の行をパースする (必要な場合はファイルをオープンする)。 .PP 関数 \fBendfsent\fP() は呼び出されると fstab ファイルをクローズする。 .PP 関数 \fBgetfsspec\fP() は fstab ファイルを先頭から検索し、 \fIfs_spec\fP フィールドが \fIspecial_file\fP 引数にマッチするエントリーが見つかったら、その最初のものを返す。 .PP 関数 \fBgetfsfile\fP() は fstab ファイルを先頭から検索し、 \fIfs_file\fP フィールドが \fImount_point\fP 引数にマッチするエントリーが見つかったら、その最初のものを返す。 .SH 返り値 .\" .SH HISTORY .\" The .\" .BR getfsent () .\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD. 成功すると、 \fBgetfsent\fP(), \fBgetfsfile\fP(), \fBgetfsspec\fP() の各関数は \fIfstab\fP 構造体へのポインターを返し、 \fBsetfsent\fP() 関数は 1 を返す。 失敗するとこれらの関数は NULL を返し、 end\-of\-file になったら 0 を返す。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lbw24 l l l. インターフェース 属性 値 T{ \fBendfsent\fP(), .br \fBsetfsent\fP() T} Thread safety MT\-Unsafe race:fsent T{ \fBgetfsent\fP(), .br \fBgetfsspec\fP(), .br \fBgetfsfile\fP() T} Thread safety MT\-Unsafe race:fsent locale .TE .SH 準拠 These functions are not in POSIX.1. Several operating systems have them, for example, *BSD, SunOS, Digital UNIX, AIX (which also has a \fBgetfstype\fP()). HP\-UX has functions of the same names, that however use a \fIstruct checklist\fP instead of a \fIstruct fstab\fP, and calls these functions obsolete, superseded by \fBgetmntent\fP(3). .SH 注意 これらの関数はスレッドセーフではない。 .PP Linux ではブロックスペシャルデバイスを複数の場所にマウントでき、 また複数のデバイスが同じマウントポイントを共有できる (この場合はそのマウントポイントに最後にマウントされたデバイスが意味を持つ) が、 \fBgetfsfile\fP() と \fBgetfsspec\fP() はマッチした最初のエントリーしか返さないので、 これらの 2 つの関数は Linux での利用には適していない。 .SH 関連項目 \fBgetmntent\fP(3), \fBfstab\fP(5) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。