Commit | Line | Data |
---|---|---|
c4665c80 TL |
1 | .TH GETLOGIN 3 |
2 | .SH NAME | |
3 | getlogin \- get login name | |
4 | .SH SYNOPSIS | |
5 | .B char *getlogin(); | |
6 | .SH DESCRIPTION | |
7 | .I Getlogin | |
8 | returns a pointer to | |
9 | the login name | |
10 | as found in | |
11 | .IR /etc/utmp . | |
12 | It may be used | |
13 | in conjunction | |
14 | with | |
15 | .I getpwnam | |
16 | to locate the correct | |
17 | password file entry | |
18 | when the same userid | |
19 | is shared by several | |
20 | login names. | |
21 | .PP | |
22 | If | |
23 | .I getlogin | |
24 | is called within a process | |
25 | that is not attached to a | |
26 | typewriter, it returns NULL. | |
27 | The correct procedure | |
28 | for determining the login name | |
29 | is to first call | |
30 | .I getlogin | |
31 | and if it fails, | |
32 | to call | |
33 | .IR getpwuid . | |
34 | .SH FILES | |
35 | /etc/utmp | |
36 | .SH "SEE ALSO" | |
37 | getpwent(3), getgrent(3), utmp(5) | |
38 | .SH DIAGNOSTICS | |
39 | Returns NULL (0) if name not found. | |
40 | .SH BUGS | |
41 | The return values point to static data | |
42 | whose content is overwritten by each call. |