.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) .\" .\" %%%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 .\" .\" Modified 2002-04-15 by Roger Luethi and aeb .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2013 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2013-03-25, Akihiro MOTOKI .\" .TH GETDTABLESIZE 3 2020\-06\-09 Linux "Linux Programmer's Manual" .SH 名前 getdtablesize \- ファイルディスクリプターテーブルのサイズを取得する .SH 書式 \fB#include \fP .PP \fBint getdtablesize(void);\fP .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBgetdtablesize\fP(): .ad l .RS 4 .PD 0 .TP 4 glibc 2.12 以降: .nf /* Glibc 2.19 以降: */ _DEFAULT_SOURCE || /* glibc 2.19 以前: */ _BSD_SOURCE || ! (_POSIX_C_SOURCE\ >=\ 200112L) .fi .TP 4 glibc 2.12 より前: .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 .PD .RE .ad b .SH 説明 \fBgetdtablesize\fP() は 1 つのプロセスのオープンできるファイル数の最大値を返す。 返り値はファイルディスクリプターの取り得る最大値より 1 大きい値である。 .SH 返り値 プロセス毎にオープンできるファイル数の現在の制限値。 .SH エラー Linux では、 \fBgetdtablesize\fP() は \fBgetrlimit\fP(2) で説明されているエラーを返すことがある。 下記の「注意」を参照のこと。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBgetdtablesize\fP() T} Thread safety MT\-Safe .TE .SH 準拠 SVr4, 4.4BSD (\fBgetdtablesize\fP() 関数は 4.2BSD で最初に現われた)。 これは POSIX.1 で規定されていないので、 移植性のあるアプリケーションはこの呼び出しの代わりに \fIsysconf(_SC_OPEN_MAX)\fP を使うべきである。 .SH 注意 .\" The libc4 and libc5 versions return .\" .B OPEN_MAX .\" (set to 256 since Linux 0.98.4). glibc 版の \fBgetdtablesize\fP() は、 \fBgetrlimit\fP(2) を呼び出して、現在の \fBRLIMIT_NOFILE\fP を返す。 呼び出しに失敗した場合は \fBOPEN_MAX\fP を返す。 .SH 関連項目 \fBclose\fP(2), \fBdup\fP(2), \fBgetrlimit\fP(2), \fBopen\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。