.\" .\" Copyright (c) 1995 Joerg Wunsch .\" .\" 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 Joerg Wunsch .\" 4. The name of the developer may not be used to endorse or promote .\" products derived from this software without specific prior written .\" permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. .\" .\" %FreeBSD: src/lib/libcompat/4.4/cuserid.3,v 1.8.2.6 2001/12/17 10:08:29 ru Exp % .\" .\" $FreeBSD$ .Dd April 10, 1995 .Os .Dt CUSERID 3 .Sh 名称 .Nm cuserid .Nd 有効な UID に対応するユーザ名を得る .Sh ライブラリ .Lb libcompat .Sh 書式 .In stdio.h .Ft char * .Fn cuserid "char *s" .Sh 解説 .Bf -symbolic .Fn cuserid 関数は .Xr getpwuid 3 によって旧式なものになりました。 .Ef .Pp 関数 .Fn cuserid は、現在のプロセスの有効な UID に対応するユーザ名を取得します。引数 .Fa s が NULL でない場合、名前は、それが指しているバッファに コピーされ、そのアドレスが返されます。このバッファは少なくとも .Em L_cuserid キャラクタ用の空間を準備する必要があります。 L_cuuserid 定数は .Aq Pa stdio.h 内に定義されます。 .Pp .Fa s が NULL の場合、内部配列が使用され、そのアドレスが返されます。 .Sh 戻り値 .Fn cuserid は、名前が保存された配列のアドレスを返します。 .Pp 現在のプロセスの有効な UID に対応する名前が見つからない場合は、NULL ポインタが返されるか、または (s が NULL でない場合) バッファ .Fa s がヌルストリングで埋められるかのどちらかです。 .Sh 関連項目 .Xr geteuid 2 , .Xr getpwuid 3