1cuserid(3C) Standard C Library Functions cuserid(3C)
2
3
4
6 cuserid - get character login name of the user
7
9 #include <stdio.h>
10
11 char *cuserid(char *s);
12
13
15 The cuserid() function generates a character-string representation of
16 the login name under which the owner of the current process is logged
17 in. If s is a null pointer, this representation is generated in an
18 internal static area whose address is returned. Otherwise, s is assumed
19 to point to an array of at least L_cuserid characters; the representa‐
20 tion is left in this array. The constant L_cuserid is defined in the
21 <stdio.h> header.
22
23
24 In multithreaded applications, the caller must always supply an array s
25 for the return value.
26
28 If the login name cannot be found, cuserid() returns a null pointer.
29 If s is not a null pointer, the null character `\0' will be placed at
30 s[0].
31
33 See attributes(5) for descriptions of the following attributes:
34
35
36
37
38 ┌─────────────────────────────┬─────────────────────────────┐
39 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
40 ├─────────────────────────────┼─────────────────────────────┤
41 │MT-Level │MT-Safe │
42 └─────────────────────────────┴─────────────────────────────┘
43
45 getlogin(3C), getpwnam(3C), attributes(5)
46
47
48
49SunOS 5.11 30 Dec 1996 cuserid(3C)