source: trunk/minix/man/man3/getlogin.3@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 986 bytes
Line 
1.\" @(#)getlogin.3 6.2 (Berkeley) 5/9/86
2.\"
3.TH GETLOGIN 3 "May 9, 1986"
4.AT 3
5.SH NAME
6getlogin \- get login name
7.SH SYNOPSIS
8.nf
9.ft B
10#include <unistd.h>
11
12char *getlogin(void)
13.fi
14.SH DESCRIPTION
15.B Getlogin
16returns a pointer to the login name as found in
17.BR /etc/utmp .
18It may be used in conjunction with
19.B getpwnam
20to locate the correct password file entry when the same user ID
21is shared by several login names.
22.PP
23If
24.B getlogin
25is called within a process that is not attached to a
26terminal, or if there is no entry in
27.B /etc/utmp
28for the process's terminal,
29.B getlogin
30returns a null pointer.
31A reasonable procedure for determining the login name is to first call
32.B getlogin
33and if it fails, to call
34.BR getpwuid ( getuid ()).
35.SH FILES
36/etc/utmp
37.SH "SEE ALSO"
38.BR getpwent (3),
39.BR utmp (5),
40.BR ttyslot (3)
41.SH DIAGNOSTICS
42Returns a null pointer if the name cannot be found.
43.SH BUGS
44The return values point to static data
45whose content is overwritten by each call.
Note: See TracBrowser for help on using the repository browser.