BSD 4_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 3 Apr 1983 18:00:46 +0000 (10:00 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 3 Apr 1983 18:00:46 +0000 (10:00 -0800)
Work on file usr/man/man3/getlogin.3

Synthesized-from: CSRG/cd1/4.2

usr/man/man3/getlogin.3 [new file with mode: 0644]

diff --git a/usr/man/man3/getlogin.3 b/usr/man/man3/getlogin.3
new file mode 100644 (file)
index 0000000..4572f35
--- /dev/null
@@ -0,0 +1,31 @@
+.TH GETLOGIN 3  "19 January 1983"
+.SH NAME
+getlogin \- get login name
+.SH SYNOPSIS
+.B char *getlogin()
+.SH DESCRIPTION
+.I Getlogin
+returns a pointer to the login name as found in
+.IR /etc/utmp .
+It may be used in conjunction with
+.I getpwnam
+to locate the correct password file entry when the same userid
+is shared by several login names.
+.PP
+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
+.I getlogin
+and if it fails, to call
+.IR getpw ( getuid ()).
+.SH FILES
+/etc/utmp
+.SH "SEE ALSO"
+getpwent(3), getgrent(3), utmp(5), getpw(3)
+.SH DIAGNOSTICS
+Returns NULL (0) if name not found.
+.SH BUGS
+The return values point to static data
+whose content is overwritten by each call.