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