1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Modified Sat Jul 24 19:53:02 1993 by Rik Faith (faith@cs.unc.edu)
24 .\" FIXME Many more values for 'name' are supported, some of which
25 .\" are documented under 'info confstr'.
26 .\" See <bits/confname.h> for the rest.
27 .\" These should all be added to this page.
28 .\" See also the POSIX.1-2001 specification of confstr()
30 .\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya
31 .\" all rights reserved.
32 .\" Translated by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
33 .\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
34 .\" Updated 2006-07-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
36 .TH CONFSTR 3 2010-02-03 "GNU" "Linux Programmer's Manual"
38 confstr \- コンフィグレーションに依存した文字列変数の取得
41 .B #include <unistd.h>
43 .BI "size_t confstr(int " "name" ", char *" buf ", size_t " len );
48 .RB ( feature_test_macros (7)
53 _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE
56 はコンフィグレーションに依存した文字列変数の値を取得する。
60 は、問い合わせ内容を表すシステム変数である。
63 .BR _CS_GNU_LIBC_VERSION " (GNU C library 限定; glibc 2.3.2 以降)"
64 そのシステムの GNU C ライブラリのバージョンを示す文字列
67 .BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library 限定; glibc 2.3.2 以降)"
68 その C ライブラリが提供している POSIX 実装を示す文字列
69 (例えば "NPTL 2.3.4" や "linuxthreads-0.10")。
72 すべての POSIX.2 標準ユーティリティが見つかるような
85 文字に切り捨てられて、NULL バイト (\(aq\\0\(aq) で終端される。
86 末尾が切り捨てられたかどうかを判定するには、
97 は以下で定義された値 (訳注: 切り捨てる前の、取得した文字列の長さ) を返す。
100 が有効なコンフィギュレーション変数の場合、
102 はその変数の値全体を保持するのに必要であったバイト数を返す
103 (文字列終端のヌルバイトも含む)。この値は
107 に格納された値の末尾が切り詰められたことを意味する。
115 が有効なコンフィグレーション変数に対応していなければ、
130 次の部分的なコードは、 POSIX.2 システムのユーティリティがあるパス
139 n = confstr(_CS_PATH,NULL,(size_t) 0);
143 confstr(_CS_PATH, pathbuf, n);