.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" 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. .\" Modified Sat Jul 24 17:51:42 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Tue Aug 17 11:42:20 1999 by Ariel Scolnicov (ariels@compugen.co.il) .\" .\" Japanese Version Copyright (c) 1998 ISHIKAWA Mutsumi, all rights reserved. .\" Translated 1998-06-03, ISHIKAWA Mutsumi .\" Updated 1999-12-08, Kentaro Shirakata .\" Updated 2002-10-16, Kentaro Shirakata .\" Updated 2005-03-15, Akihiro MOTOKI .\" .TH SYSCONF 3 2007-12-12 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .\"O sysconf \- Get configuration information at runtime .SH 名前 sysconf \- 動作中に設定情報を取得する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "long sysconf(int " "name" ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O POSIX allows an application to test at compile or run time .\"O whether certain options are supported, or what the value is .\"O of certain configurable constants or limits. POSIX では、アプリケーションがコンパイル時や実行時に、 特定のオプションがサポートされているかや、 設定可能な特定の定数や制限がどんな値かをテストすることができる。 .LP .\"O At compile time this is done by including .\"O .I .\"O and/or .\"O .I .\"O and testing the value of certain macros. コンパイル時に行うには、 .I と .I の両方もしくは一方をインクルードし、 特定のマクロの値を確認する。 .LP .\"O At run time, one can ask for numerical values using the present function .\"O .BR sysconf (). .\"O One can ask for numerical values that may depend .\"O on the file system a file is in using the calls .\"O .BR fpathconf (3) .\"O and .\"O .BR pathconf (3). .\"O One can ask for string values using .\"O .BR confstr (3). 実行時には、ここで説明する関数 .BR sysconf () を使って数値を問い合わせることができる。 ファイルが存在するファイルシステムに関する数値は、 .BR fpathconf (3) と .BR pathconf (3) を使って確認できる。 文字列の値は .BR confstr (3) を使って確認できる。 .LP .\"O The values obtained from these functions are system configuration constants. .\"O They do not change during the lifetime of a process. .\"O .\" except that sysconf(_SC_OPEN_MAX) may change answer after a call .\"O .\" to setrlimit( ) which changes the RLIMIT_NOFILE soft limit これらの関数で取得される値は設定可能なシステム定数である。 これらはプロセスの生存期間の間は変化しない。 .\" 但し RLIMIT_NOFILE ソフト・リミットを変更する setrlimit() が呼び出した .\" 後では、 sysconf(_SC_OPEN_MAX) が返す値は変化するかもしれない。 .LP .\"O For options, typically, there is a constant .\"O .B _POSIX_FOO .\"O that may be defined in .\"O .IR . .\"O If it is undefined, one should ask at run time. .\"O If it is defined to \-1, then the option is not supported. .\"O If it is defined to 0, then relevant functions and headers exist, .\"O but one has to ask at runtime what degree of support is available. .\"O If it is defined to a value other than \-1 or 0, then the option is .\"O supported. .\"O Usually the value (such as 200112L) indicates the year and month .\"O of the POSIX revision describing the option. .\"O Glibc uses the value 1 .\"O to indicate support as long as the POSIX revision has not been published yet. オプションを確認できるように、たいていは .I で定数 .B _POSIX_FOO が定義されている。 定義されていないときは、実行時に問い合わせを行う必要がある。 その値が \-1 に定義されているときは、そのオプションはサポートされていない。 0 に定義されているときは、関連する関数やヘッダファイルが存在するが、 どの程度サポートされているかは実行時に確認しなければならない。 \-1 でも 0 でもない値に定義されているときは、そのオプションがサポート されている。通常は、そのオプションについて記載した POSIX の改訂年月 を示す値になっている (例えば 200112L)。 glibc では 1 が設定されていると、そのオプションはサポートされているが、 POSIX の改訂版がまだ発行されていないことを示す。 .\"O .\" and 999 to indicate support for options no longer present in the latest .\"O .\" standard. (?) .\" 999 は、そのオプションはサポートされているが、 .\" 最新の標準にはもはや存在しないことを示す。(?) .\"O The .\"O .BR sysconf () .\"O argument will be .\"O .BR _SC_FOO . .\"O For a list of options, see .\"O .BR posixoptions (7). .BR sysconf () の引き数には .B _SC_FOO を指定する。 オプションのリストについては .BR posixoptions (7) を参照のこと。 .LP .\"O For variables or limits, typically, there is a constant .\"O .BR _FOO , .\"O maybe defined in .\"O .IR , .\"O or .\"O .BR _POSIX_FOO , .\"O maybe defined in .\"O .IR . 変数や制限を確認できるように、たいていは、 .I で定数 .B _FOO が、 .I で .B _POSIX_FOO が定義されている。 .\"O The constant will not be defined if the limit is unspecified. .\"O If the constant is defined, it gives a guaranteed value, and .\"O a greater value might actually be supported. .\"O If an application wants to take advantage of values which may change .\"O between systems, a call to .\"O .BR sysconf () .\"O can be made. 制限が規定されていない場合は定数は定義されない。 定数が定義されているときには、その定数は保証できる値であり、 実際にはもっと大きな値がサポートされていることもある。 アプリケーションがシステム毎に変化する値を利用したい場合には、 .BR sysconf () を呼び出すことで実現できる。 .\"O The .\"O .BR sysconf () .\"O argument will be .\"O .BR _SC_FOO . .BR sysconf () の引き数には .B _SC_FOO を指定する。 .\"O .SS "POSIX.1 Variables" .SS "POSIX.1 変数" .\"O We give the name of the variable, the name of the .\"O .BR sysconf () .\"O argument used to inquire about its value, .\"O and a short description. 変数名、その値を取得するのに使われる .BR sysconf () のパラメータ名、簡単な説明を以下に示す。 .LP .\"O First, the POSIX.1 compatible values. まず POSIX.1 互換の変数を示す。 .\"O .\" [for the moment: only the things that are unconditionally present] .\"O .\" .TP .\"O .\" .BR AIO_LISTIO_MAX " - " _SC_AIO_LISTIO_MAX .\"O .\" (if _POSIX_ASYNCHRONOUS_IO) .\"O .\" Maximum number of I/O operations in a single list I/O call. .\"O .\" Must not be less than _POSIX_AIO_LISTIO_MAX. .\"O .\" .TP .\"O .\" .BR AIO_MAX " - " _SC_AIO_MAX .\"O .\" (if _POSIX_ASYNCHRONOUS_IO) .\"O .\" Maximum number of outstanding asynchronous I/O operations. .\"O .\" Must not be less than _POSIX_AIO_MAX. .\"O .\" .TP .\"O .\" .BR AIO_PRIO_DELTA_MAX " - " _SC_AIO_PRIO_DELTA_MAX .\"O .\" (if _POSIX_ASYNCHRONOUS_IO) .\"O .\" The maximum amount by which a process can decrease its .\"O .\" asynchronous I/O priority level from its own scheduling priority. .\"O .\" Must be nonnegative. .TP .BR ARG_MAX " - " _SC_ARG_MAX .\"O The maximum length of the arguments to the .\"O .BR exec (3) .\"O family of functions. .\"O Must not be less than .\"O .B _POSIX_ARG_MAX .\"O (4096). .BR exec (3) 関数群の引き数の最大長。 .B _POSIX_ARG_MAX (4096) 未満であってはならない。 .TP .BR CHILD_MAX " - " _SC_CHILD_MAX .\"O The max number of simultaneous processes per user ID. .\"O Must not be less than .\"O .B _POSIX_CHILD_MAX .\"O (25). ユーザID あたりの同時に存在できるプロセスの最大数。 .B _POSIX_CHILD_MAX (25) 未満であってはならない。 .TP .BR HOST_NAME_MAX " - " _SC_HOST_NAME_MAX .\"O Max length of a hostname, not including the terminating null byte, .\"O as returned by .\"O .BR gethostname (2). .\"O Must not be less than .\"O .B _POSIX_HOST_NAME_MAX .\"O (255). .BR gethostname (2) で返されるホスト名の最大長。末尾の NULL バイトは長さに含まれない。 .B _POSIX_HOST_NAME_MAX (255) 未満であってはならない。 .TP .BR LOGIN_NAME_MAX " - " _SC_LOGIN_NAME_MAX .\"O Maximum length of a login name, including the terminating null byte. .\"O Must not be less than .\"O .B _POSIX_LOGIN_NAME_MAX .\"O (9). ログイン名の長さの最大値。末尾の NULL バイトも長さに含まれる。 .B _POSIX_LOGIN_NAME_MAX (9) 未満であってはならない。 .TP .BR "" "clock ticks - " _SC_CLK_TCK .\"O The number of clock ticks per second. .\"O The corresponding variable is obsolete. .\"O It was of course called .\"O .BR CLK_TCK . .\"O (Note: the macro .\"O .B CLOCKS_PER_SEC .\"O does not give information: it must equal 1000000.) 1秒あたりのクロック・ティック数。 対応する変数は廃止された。この変数は当然ながら .B CLK_TCK と呼ばれていた。 (注意: マクロ .B CLOCKS_PER_SEC からは情報は得られない: この値は 1000000 でなければならない) .TP .BR OPEN_MAX " - " _SC_OPEN_MAX .\"O The maximum number of files that a process can have open at any time. .\"O Must not be less than .\"O .B _POSIX_OPEN_MAX .\"O (20). 一つのプロセスが同時にオープンできるファイル数の上限。 .B _POSIX_OPEN_MAX (20) 未満であってはならない。 .TP .BR PAGESIZE " - " _SC_PAGESIZE .\"O Size of a page in bytes. .\"O Must not be less than 1. .\"O (Some systems use PAGE_SIZE instead.) バイト単位でのページサイズ。 1 より小さくなってはならない。 (この代わりに PAGE_SIZE を使うシステムもある) .TP .BR RE_DUP_MAX " - " _SC_RE_DUP_MAX .\"O The number of repeated occurrences of a BRE permitted by .\"O .BR regexec (3) .\"O and .\"O .BR regcomp (3). .\"O Must not be less than .\"O .B _POSIX2_RE_DUP_MAX .\"O (255). .BR regexec (3) と .BR regcomp (3) で許容されている BRE (Basic Regular Expression; 基本正規表現) の繰り返し出現回数の最大値。 .B _POSIX2_RE_DUP_MAX (255) 未満であってはならない。 .TP .BR STREAM_MAX " - " _SC_STREAM_MAX .\"O The maximum number of streams that a process can have open at any .\"O time. .\"O If defined, it has the same value as the standard C macro .\"O .BR FOPEN_MAX . .\"O Must not be less than .\"O .B _POSIX_STREAM_MAX .\"O (8). 一つのプロセスが同時にオープンできるストリーム数の上限。 定義されていた場合には、この値は標準 C マクロの .B FOPEN_MAX と同じである。 .B _POSIX_STREAM_MAX (8) 未満であってはならない。 .TP .B SYMLOOP_MAX .\"O The maximum number of symbolic links seen in a pathname before resolution .\"O returns .\"O .BR ELOOP . .\"O Must not be less than .\"O .B _POSIX_SYMLOOP_MAX .\"O (8). パス名の解決時に現れてもよいシンボリック・リンクの最大数。 この数を超えると、パス名解決時に .B ELOOP が返される。 .B _POSIX_SYMLOOP_MAX (8) 未満であってはならない。 .TP .BR TTY_NAME_MAX " - " _SC_TTY_NAME_MAX .\"O The maximum length of terminal device name, .\"O including the terminating null byte. .\"O Must not be less than .\"O .B _POSIX_TTY_NAME_MAX .\"O (9). 端末デバイス名の最大長。長さには末尾の NULL バイトも含まれる。 .B _POSIX_TTY_NAME_MAX (9) 未満であってはならない。 .TP .BR TZNAME_MAX " - " _SC_TZNAME_MAX .\"O The maximum number of bytes in a timezone name. .\"O Must not be less than .\"O .B _POSIX_TZNAME_MAX .\"O (6). タイムゾーン名として使えるバイト数の最大値。 .B _POSIX_TZNAME_MAX (6) 未満であってはならない。 .TP .BR _POSIX_VERSION " - " _SC_VERSION .\"O indicates the year and month the POSIX.1 standard was approved in the .\"O format .\"O .BR YYYYMML ; .\"O the value .\"O .B 199009L .\"O indicates the Sept. 1990 revision. POSIX.1 標準が承認された年月。 .B YYYYMML という書式である。 .B 199009L という値は、1990年 9月 改訂であることを示す。 .\"O .SS "POSIX.2 Variables" .SS "POSIX.2 変数" .\"O Next, the POSIX.2 values, giving limits for utilities. 次に、POSIX.2 の値を示す。 これらは各ユーティリティに対する制限を指定する。 .TP .BR BC_BASE_MAX " - " _SC_BC_BASE_MAX .\"O indicates the maximum .\"O .I obase .\"O value accepted by the .\"O .BR bc (1) .\"O utility. .BR bc (1) ユーティリティで許容される .I obase の最大値。 .TP .BR BC_DIM_MAX " - " _SC_BC_DIM_MAX .\"O indicates the maximum value of elements permitted in an array by .\"O .BR bc (1). .BR bc (1) で許容される一つの配列中の要素数の最大値。 .TP .BR BC_SCALE_MAX " - " _SC_BC_SCALE_MAX .\"O indicates the maximum .\"O .I scale .\"O value allowed by .\"O .BR bc (1). .BR bc (1) で許される .I scale の最大値。 .TP .BR BC_STRING_MAX " - " _SC_BC_STRING_MAX .\"O indicates the maximum length of a string accepted by .\"O .BR bc (1). .BR bc (1) で許容される文字列の最大長。 .TP .BR COLL_WEIGHTS_MAX " - " _SC_COLL_WEIGHTS_MAX .\"O indicates the maximum numbers of weights that can be assigned to an .\"O entry of the .\"O .B LC_COLLATE order .\"O keyword in the locale definition file, ロケール定義ファイル中の .B LC_COLLATE order キーワードのエントリに割り当て可能な重みの最大値。 .TP .BR EXPR_NEST_MAX " - " _SC_EXPR_NEST_MAX .\"O is the maximum number of expressions which can be nested within .\"O parentheses by .\"O .BR expr (1). .BR expr (1) において、括弧で入れ子にできる式の最大数。 .TP .BR LINE_MAX " - " _SC_LINE_MAX .\"O The maximum length of a utility's input line length, either from .\"O standard input or from a file. .\"O This includes length for a trailing .\"O newline. ユーティリティの入力行の最大長。標準入力だけでなく、ファイルからの入力にも 適用される。長さには行の末尾の改行文字も含まれる。 .TP .BR RE_DUP_MAX " - " _SC_RE_DUP_MAX .\"O The maximum number of repeated occurrences of a regular expression when .\"O the interval notation .\"O .B \e{m,n\e} .\"O is used. 正規表現で区間表記 (interval notation) .B \e{m,n\e} が使用されたときに許容される繰り返し出現回数の最大値。 .TP .BR POSIX2_VERSION " - " _SC_2_VERSION .\"O indicates the version of the POSIX.2 standard in the format of .\"O YYYYMML. POSIX.2 標準のバージョン。YYYYMML という書式で表記される。 .TP .BR POSIX2_C_DEV " - " _SC_2_C_DEV .\"O indicates whether the POSIX.2 C language development facilities are .\"O supported. POSIX.2 の C 言語開発機能がサポートされているかを示す。 .TP .BR POSIX2_FORT_DEV " - " _SC_2_FORT_DEV .\"O indicates whether the POSIX.2 FORTRAN development utilities are .\"O supported. POSIX.2 の FORTRAN 開発ユーティリティがサポートされているかを示す。 .TP .BR POSIX2_FORT_RUN " - " _SC_2_FORT_RUN .\"O indicates whether the POSIX.2 FORTRAN runtime utilities are supported. POSIX.2 の FORTRAN ランタイムユーティリティがサポートされているかを示す。 .TP .BR _POSIX2_LOCALEDEF " - " _SC_2_LOCALEDEF .\"O indicates whether the POSIX.2 creation of locates via .\"O .BR localedef (1) .\"O is supported. .BR localedef (1) を使った、POSIX.2 のロケールの作成をサポートしているかを示す。 .TP .BR POSIX2_SW_DEV " - " _SC_2_SW_DEV .\"O indicates whether the POSIX.2 software development utilities option is .\"O supported. POSIX.2 ソフトウェア開発ユーティリティオプションがサポートされているかを示す。 .PP .\"O These values also exist, but may not be standard. 以下の値も存在するが、標準には含まれていない。 .TP .BR "" " - " _SC_PHYS_PAGES .\"O The number of pages of physical memory. .\"O Note that it is possible .\"O for the product of this value and the value of .\"O .B _SC_PAGE_SIZE .\"O to overflow. 物理メモリのページ数。 この値と .B _SC_PAGE_SIZE 値の積は桁溢れする可能性があるので注意すること。 .TP .BR "" " - " _SC_AVPHYS_PAGES .\"O The number of currently available pages of physical memory. 現在利用可能な物理メモリのページ数。 .TP .BR "" " - " _SC_NPROCESSORS_CONF .\"O The number of processors configured. 設定されたプロセッサ数。 .TP .BR "" " - " _SC_NPROCESSORS_ONLN .\"O The number of processors currently online (available). 現在オンラインの (利用可能な) プロセッサ数。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O If .\"O .I name .\"O is invalid, \-1 is returned, and .\"O .I errno .\"O is set to .\"O .BR EINVAL . .I name が不正な場合、\-1 が返され、 .I errno に .B EINVAL が設定される。 .\"O Otherwise, the value returned is the value of the system resource and .\"O .I errno .\"O is not changed. .\"O In the case of options, a positive value is returned if a queried option .\"O is available, and \-1 if it is not. .\"O In the case of limits, \-1 means that there is no definite limit. それ以外の場合、システムリソースの値が返り値として返され、 .I errno は変更されない。問い合わせがオプションについてであれば、 そのオプションが利用できるときは正の値が返され、 利用できないときは \-1 が返される。問い合わせが 制限について場合は、制限が設定されていないときに \-1 が返される。 .\"O .SH "CONFORMING TO" .SH 準拠 POSIX.1-2001. .\"O .SH "BUGS" .SH バグ .\"O It is difficult to use .\"O .B ARG_MAX .\"O because it is not specified how much of the argument space for .\"O .BR exec (3) .\"O is consumed by the user's environment variables. .B ARG_MAX を使うのは難しい、なぜなら、 .BR exec (3) の引き数領域 (argument space) のうちどれくらいが ユーザの環境変数によって使われるかは分からないからである。 .PP .\"O Some returned values may be huge; they are not suitable for allocating .\"O memory. いくつかの返り値はとても大きくなるだろう。これらを使って メモリの割り当てを行うのは適当ではない。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR bc (1), .BR expr (1), .BR getconf (1), .BR locale (1), .BR fpathconf (3), .BR pathconf (3), .BR posixoptions (7)