.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) .\" .\" 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. .\" .\" Modified 2002-04-15 by Roger Luethi and aeb .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH GETDTABLESIZE 2 2010\-09\-20 Linux "Linux Programmer's Manual" .SH 名前 getdtablesize \- ディスクリプタ・テーブルのサイズを取得する .SH 書式 \fB#include \fP .sp \fBint getdtablesize(void);\fP .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp \fBgetdtablesize\fP(): .ad l .RS 4 .PD 0 .TP 4 glibc 2.12 以降: .nf _BSD_SOURCE || !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) .TP 4 .fi glibc 2.12 より前: _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b .SH 説明 \fBgetdtablesize\fP() は 1 つのプロセスのオープンできるファイル数の最大値を返す。 返り値はファイルディスクリプタの取り得る最大値より 1 大きい値である。 .SH 返り値 プロセス毎にオープンできるファイル数の現在の制限値。 .SH エラー Linux では、 \fBgetdtablesize\fP() は \fBgetrlimit\fP(2) で説明されているエラーを返すことがある。 下記の「注意」を参照のこと。 .SH 準拠 SVr4, 4.4BSD (\fBgetdtablesize\fP() 関数は 4.2BSD で最初に現われた)。 これは POSIX.1\-2001 で規定されていないので、 移植性のあるアプリケーションはこの呼び出しの代わりに \fIsysconf(_SC_OPEN_MAX)\fP を使うべきである。 .SH 注意 \fBgetdtablesize\fP() は libc のライブラリ関数として実装されている。glibc 版は \fBgetrlimit\fP(2) を呼び出して、現在の \fBRLIMIT_NOFILE\fP を返す。 呼び出しに失敗した場合は \fBOPEN_MAX\fP を返す。 libc4 と libc5 では \fBOPEN_MAX\fP (Linux 0.98.4 以降では 256 に設定されている) を返す。 .SH 関連項目 \fBclose\fP(2), \fBdup\fP(2), \fBgetrlimit\fP(2), \fBopen\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。