1GETLOGIN(3) Library Functions Manual GETLOGIN(3)
2
3
4
6 getlogin - get login name
7
9 char *getlogin();
10
12 Getlogin returns a pointer to the login name as found in /etc/utmp. It
13 may be used in conjunction with getpwnam to locate the correct password
14 file entry when the same userid is shared by several login names.
15
16 If getlogin is called within a process that is not attached to a type‐
17 writer, it returns NULL. The correct procedure for determining the
18 login name is to first call getlogin and if it fails, to call getpwuid.
19
21 /etc/utmp
22
24 getpwent(3), getgrent(3), utmp(5)
25
27 Returns NULL (0) if name not found.
28
30 The return values point to static data whose content is overwritten by
31 each call.
32
33
34
35 GETLOGIN(3)