xref: /freebsd/lib/libcompat/4.4/cuserid.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1a7240857SJoerg Wunsch.\"
2a7240857SJoerg Wunsch.\" Copyright (c) 1995 Joerg Wunsch
3a7240857SJoerg Wunsch.\"
4a7240857SJoerg Wunsch.\" All rights reserved.
5a7240857SJoerg Wunsch.\"
6a7240857SJoerg Wunsch.\" Redistribution and use in source and binary forms, with or without
7a7240857SJoerg Wunsch.\" modification, are permitted provided that the following conditions
8a7240857SJoerg Wunsch.\" are met:
9a7240857SJoerg Wunsch.\" 1. Redistributions of source code must retain the above copyright
10a7240857SJoerg Wunsch.\"    notice, this list of conditions and the following disclaimer.
11a7240857SJoerg Wunsch.\" 2. Redistributions in binary form must reproduce the above copyright
12a7240857SJoerg Wunsch.\"    notice, this list of conditions and the following disclaimer in the
13a7240857SJoerg Wunsch.\"    documentation and/or other materials provided with the distribution.
14a7240857SJoerg Wunsch.\" 3. All advertising materials mentioning features or use of this software
15a7240857SJoerg Wunsch.\"    must display the following acknowledgement:
16a7240857SJoerg Wunsch.\" This product includes software developed by Joerg Wunsch
17a7240857SJoerg Wunsch.\" 4. The name of the developer may not be used to endorse or promote
18a7240857SJoerg Wunsch.\"    products derived from this software without specific prior written
19a7240857SJoerg Wunsch.\"    permission.
20a7240857SJoerg Wunsch.\"
21a7240857SJoerg Wunsch.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
22a7240857SJoerg Wunsch.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23a7240857SJoerg Wunsch.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24a7240857SJoerg Wunsch.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
25a7240857SJoerg Wunsch.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26a7240857SJoerg Wunsch.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27a7240857SJoerg Wunsch.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28a7240857SJoerg Wunsch.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29a7240857SJoerg Wunsch.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30a7240857SJoerg Wunsch.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31a7240857SJoerg Wunsch.\"
32a7240857SJoerg Wunsch.Dd April 10, 1995
33a7240857SJoerg Wunsch.Dt CUSERID 3
34*aa12cea2SUlrich Spörlein.Os
35a7240857SJoerg Wunsch.Sh NAME
36a7240857SJoerg Wunsch.Nm cuserid
37a7240857SJoerg Wunsch.Nd get user name associated with effective UID
38b9b9e020SBen Smithurst.Sh LIBRARY
39b9b9e020SBen Smithurst.Lb libcompat
40a7240857SJoerg Wunsch.Sh SYNOPSIS
4132eef9aeSRuslan Ermilov.In stdio.h
42a7240857SJoerg Wunsch.Ft char *
43a7240857SJoerg Wunsch.Fn cuserid "char *s"
44a7240857SJoerg Wunsch.Sh DESCRIPTION
45a7240857SJoerg Wunsch.Bf -symbolic
46563f6bdeSRuslan ErmilovThe
47563f6bdeSRuslan Ermilov.Fn cuserid
48563f6bdeSRuslan Ermilovfunction is made obsolete by
49563f6bdeSRuslan Ermilov.Xr getpwuid 3 .
50a7240857SJoerg Wunsch.Ef
51a7240857SJoerg Wunsch.Pp
52a7240857SJoerg WunschThe function
53563f6bdeSRuslan Ermilov.Fn cuserid
54a7240857SJoerg Wunschgets the user name associated with the effective UID of the current
551a0a9345SRuslan Ermilovprocess.
561a0a9345SRuslan ErmilovIf the argument
57a7240857SJoerg Wunsch.Fa s
58a2dca207SBrian Feldmanis non-NULL, the name is copied to the buffer it points to,
591a0a9345SRuslan Ermilovand that address is being returned.
601a0a9345SRuslan ErmilovThis buffer must provide space
61a7240857SJoerg Wunschfor at least
62a7240857SJoerg Wunsch.Em L_cuserid
63c6ff3a1bSSheldon Hearncharacters.
64c6ff3a1bSSheldon HearnThe L_cuserid constant is defined in
65fe08efe6SRuslan Ermilov.In stdio.h .
6642635956SRuslan Ermilov.Pp
67a7240857SJoerg WunschIf
68a7240857SJoerg Wunsch.Fa s
69a2dca207SBrian Feldmanis NULL, an internal array is used and its address will be returned.
70a7240857SJoerg Wunsch.Sh RETURN VALUES
710552350eSPhilippe CharnierThe
72563f6bdeSRuslan Ermilov.Fn cuserid
730552350eSPhilippe Charnierfunction returns the address of an array in which the name has been stored.
7442635956SRuslan Ermilov.Pp
75a7240857SJoerg WunschIf the name associated with the effective UID of the current process
76a7240857SJoerg Wunschcould not be found, either a null pointer will be returned, or
77c4d9468eSRuslan Ermilov(if
78a7240857SJoerg Wunsch.Fa s
79c4d9468eSRuslan Ermilovis non-NULL)
80a7240857SJoerg Wunschthe buffer
81a7240857SJoerg Wunsch.Fa s
82a7240857SJoerg Wunschwill be filled with a null string.
83a7240857SJoerg Wunsch.Sh SEE ALSO
8475141cc9SWolfram Schneider.Xr geteuid 2 ,
8575141cc9SWolfram Schneider.Xr getpwuid 3
86