define new library function getgrouplist
[unix-history] / usr / src / lib / libc / gen / getlogin.3
index 9bdb56d..249edec 100644 (file)
@@ -1,4 +1,4 @@
-.\"    @(#)getlogin.3  6.1 (Berkeley) %G%
+.\"    @(#)getlogin.3  6.3 (Berkeley) %G%
 .\"
 .TH GETLOGIN 3  ""
 .AT 3
 .\"
 .TH GETLOGIN 3  ""
 .AT 3
@@ -9,7 +9,7 @@ getlogin \- get login name
 .SH DESCRIPTION
 .I Getlogin
 returns a pointer to the login name as found in
 .SH DESCRIPTION
 .I Getlogin
 returns a pointer to the login name as found in
-.IR /etc/utmp .
+.IR /var/run/utmp .
 It may be used in conjunction with
 .I getpwnam
 to locate the correct password file entry when the same userid
 It may be used in conjunction with
 .I getpwnam
 to locate the correct password file entry when the same userid
@@ -18,17 +18,21 @@ is shared by several login names.
 If
 .I getlogin
 is called within a process that is not attached to a
 If
 .I getlogin
 is called within a process that is not attached to a
-typewriter, it returns NULL.
-The correct procedure for determining the login name is to first call
+terminal, or if there is no entry in
+.I /var/run/utmp
+for the process's terminal,
+.I getlogin
+returns a NULL pointer (0).
+A reasonable procedure for determining the login name is to first call
 .I getlogin
 and if it fails, to call
 .I getlogin
 and if it fails, to call
-.IR getpw ( getuid ()).
+.IR getpwuid ( getuid ()).
 .SH FILES
 .SH FILES
-/etc/utmp
+/var/run/utmp
 .SH "SEE ALSO"
 .SH "SEE ALSO"
-getpwent(3), getgrent(3), utmp(5), getpw(3)
+getpwent(3), utmp(5), ttyslot(3)
 .SH DIAGNOSTICS
 .SH DIAGNOSTICS
-Returns NULL (0) if name not found.
+Returns a NULL pointer (0) if name not found.
 .SH BUGS
 The return values point to static data
 whose content is overwritten by each call.
 .SH BUGS
 The return values point to static data
 whose content is overwritten by each call.