1
0
Files
irix-657m-src/eoe/cmd/sccs/lib/comobj/logname.c
2022-09-29 17:59:04 +03:00

30 lines
677 B
C

/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
/* UNIX System Laboratories, Inc. */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/* #ident "@(#)sccs:lib/comobj/logname.c 6.6" */
#ident "$Revision: 1.6 $"
# include <pwd.h>
# include <sys/types.h>
# include <macros.h>
char *logname()
{
struct passwd *log_name;
uid_t uid;
uid = getuid();
log_name = getpwuid(uid);
endpwent();
if (! log_name)
return(0);
else
return(log_name->pw_name);
}