.\" Copyright (C) 2005 Robert Love .\" and Copyright (C) 2008, Michael Kerrisk .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" 2005-07-19 Robert Love - initial version .\" 2006-02-07 mtk, minor changes .\" 2008-10-10 mtk: add description of inotify_init1() .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2006-08-15, Akihiro MOTOKI , LDP v2.39 .\" Updated 2008-11-10, Akihiro MOTOKI , LDP v3.12 .\" Updated 2012-05-29, Akihiro MOTOKI .\" .TH INOTIFY_INIT 2 2020\-04\-11 Linux "Linux Programmer's Manual" .SH 名前 inotify_init, inotify_init1 \- inotify インスタンスを初期化する .SH 書式 .nf \fB#include \fP .PP \fBint inotify_init(void);\fP \fBint inotify_init1(int \fP\fIflags\fP\fB);\fP .fi .SH 説明 inotify API の概要については \fBinotify\fP(7) を参照。 .PP \fBinotify_init\fP() は、新規の inotify インスタンスを初期化し、作成された inotify イベントキュー に対応するファイルディスクリプターを返す。 .PP \fBinotify_init1\fP() は、 \fIflags\fP が 0 の場合、 \fBinotify_init\fP() と同じである。 \fIflags\fP に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることができる。 .TP \fBIN_NONBLOCK\fP Set the \fBO_NONBLOCK\fP file status flag on the open file description (see \fBopen\fP(2)) referred to by the new file descriptor. Using this flag saves extra calls to \fBfcntl\fP(2) to achieve the same result. .TP \fBIN_CLOEXEC\fP 新しいファイルディスクリプターに対して close\-on\-exec (\fBFD_CLOEXEC\fP) フラグをセットする。 このフラグが役に立つ理由については、 \fBopen\fP(2) の \fBO_CLOEXEC\fP フラグの説明を参照のこと。 .SH 返り値 成功すると、これらのシステムコールは新しいファイルディスクリプターを返す。 エラーの場合、\-1 を返し、 \fIerrno\fP をエラーを示す値に設定する。 .SH エラー .TP \fBEINVAL\fP (\fBinotify_init1\fP()) 無効な値が \fIflags\fP に指定された。 .TP \fBEMFILE\fP inotify インスタンスの総数がユーザー単位の上限に達していた。 .TP \fBEMFILE\fP The per\-process limit on the number of open file descriptors has been reached. .TP \fBENFILE\fP オープンされたファイルの総数がシステム全体の上限に達していた。 .TP \fBENOMEM\fP カーネルメモリーが十分になかった。 .SH バージョン \fBinotify_init\fP() は Linux 2.6.13 で初めて登場し、 ライブラリによるサポートは glibc バージョン 2.4 で追加された。 \fBinotify_init1\fP() は Linux 2.6.27 で追加され、 ライブラリによるサポートは glibc バージョン 2.9 で追加された。 .SH 準拠 これらのシステムコールは Linux 独自である。 .SH 関連項目 \fBinotify_add_watch\fP(2), \fBinotify_rm_watch\fP(2), \fBinotify\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。