home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
unix
/
unixlib36d
/
src
/
c
/
getlogin
< prev
next >
Wrap
Text File
|
1994-03-08
|
512b
|
34 lines
#ifdef __STDC__
static char sccs_id[] = "@(#) getlogin.c 1.0 " __DATE__ " HJR";
#else
static char sccs_id[] = "@(#) getlogin.c 1.0 26/9/90 HJR";
#endif
/* getlogin.c (c) Copyright 1990 H.Rogers */
#include "pwd.h"
#include "unistd.h"
#ifdef __STDC__
extern int getuid (void);
#else
extern int getuid ();
#endif
/* getlogin() */
#ifdef __STDC__
char *
getlogin (void)
#else
char *
getlogin ()
#endif
{
register struct passwd *p;
if (!(p = getpwuid (getuid ())))
return (0);
return (p->pw_name);
}