jpman project specific RCS keyword (jpman %Id) is obsolete, after manual entries are stored in freefall CVS repository. This old Id is useless and more worse it confuses users and bug reporters. So, this old Id is removed. Submitted by:jpman project <man-jp@jp.FreeBSD.org>
130 lines
3.5 KiB
Groff
130 lines
3.5 KiB
Groff
.\" Copyright (c) 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" @(#)confstr.3 8.1 (Berkeley) 6/4/93
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd June 4, 1993
|
|
.Dt CONFSTR 3
|
|
.Os BSD 4
|
|
.Sh 名称
|
|
.Nm confstr
|
|
.Nd ストリング値の環境設定可能な変数を得る
|
|
.Sh 書式
|
|
.Fd #include <unistd.h>
|
|
.Ft size_t
|
|
.Fn confstr "int name" "char *buf" "size_t len"
|
|
.Sh 解説
|
|
.Bf -symbolic
|
|
このインタフェースは、
|
|
.Xr sysctl 3
|
|
によって旧式になっています。
|
|
.Ef
|
|
.Pp
|
|
.Fn confstr
|
|
関数は、環境設定で定義したストリング値をアプリケーションが
|
|
得るための方式を提供します。
|
|
.Pp
|
|
.Fa name
|
|
引数は、照会されるシステム変数を指定します。各名前の値の
|
|
シンボリック定数は、インクルードファイル
|
|
.Li <unistd.h>
|
|
の中にあります。
|
|
.Fa len
|
|
引数は、引数
|
|
.Fa buf
|
|
が参照するバッファのサイズを指定します。
|
|
.Fa len
|
|
がゼロでない
|
|
場合、
|
|
.Fa buf
|
|
は
|
|
NULL
|
|
でないポインタであり、
|
|
.Fa name
|
|
には、最高
|
|
.Fa len
|
|
\- 1
|
|
バイトの
|
|
値があり、値はバッファ
|
|
.Fa buf
|
|
にコピーされます。コピーされた値の末尾は必ず
|
|
NULL
|
|
です。
|
|
.Pp
|
|
利用可能な値は次のとおりです。
|
|
.Pp
|
|
.Bl -tag -width "123456"
|
|
.Pp
|
|
.It Li _CS_PATH
|
|
全標準ユーティリティを検出する
|
|
.Ev PATH
|
|
環境設定変数の値を返します。
|
|
.El
|
|
.Sh 戻り値
|
|
.Fn confstr
|
|
の呼び出しが正常に完了しない場合、
|
|
\-1 が返され、該当する
|
|
.Va errno
|
|
が
|
|
設定されます。そうでない場合、変数に環境設定定義された値がない場合、
|
|
0 が
|
|
返され、
|
|
.Va errno
|
|
は修正されません。そうでない場合は、環境設定定義された
|
|
値全体を入れるのに必要なバッファサイズが返されます。このサイズが引数
|
|
.Fa len
|
|
より大きい場合、
|
|
.Fa buf
|
|
内のストリングは切り捨てされます。
|
|
.Sh エラー
|
|
.Fn confstr
|
|
関数は、処理が正常に完了せず、ライブラリ関数
|
|
.Xr malloc 3
|
|
と
|
|
.Xr sysctl 3
|
|
用に指定されたエラーについて
|
|
.Va error
|
|
を設定することがあります。
|
|
.Pp
|
|
さらに、次のエラーがレポートされることがあります。
|
|
.Bl -tag -width Er
|
|
.It Bq Er EINVAL
|
|
.Fa name
|
|
引数の値は無効です。
|
|
.Pp
|
|
.Sh 関連項目
|
|
.Xr sysctl 3
|
|
.Sh 歴史
|
|
.Fn confstr
|
|
関数は
|
|
.Bx 4.4
|
|
で最初に現れました。
|