mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-06-18 09:30:45 +00:00
Bring who up to snuff with rest of source tree
This commit is contained in:
parent
320f77f2b4
commit
f53219715c
|
@ -1,7 +1,6 @@
|
||||||
# @(#)Makefile 8.1 (Berkeley) 6/6/93
|
# @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||||
|
# $Id: Makefile,v 1.3 1998/01/25 23:36:25 taubert Exp $
|
||||||
|
|
||||||
PROG= who
|
PROG= who
|
||||||
|
|
||||||
.INCLUDEDIRS : ..
|
.INCLUDE: /src/gno/prog.mk
|
||||||
.INCLUDE : <bsd.prog.mk>
|
|
||||||
|
|
||||||
|
|
|
@ -31,74 +31,75 @@
|
||||||
.\"
|
.\"
|
||||||
.\" @(#)who.1 8.2 (Berkeley) 12/30/93
|
.\" @(#)who.1 8.2 (Berkeley) 12/30/93
|
||||||
.\"
|
.\"
|
||||||
.\" $Id: who.1,v 1.1 1997/10/26 17:12:24 gdr Exp $
|
.Dd December 30, 1993
|
||||||
.\"
|
.Dt WHO 1
|
||||||
.TH WHO 1 "26 October 1997" GNO "Commands and Applications"
|
.Os
|
||||||
.SH NAME
|
.Sh NAME
|
||||||
.BR who
|
.Nm who
|
||||||
\- display who is logged in
|
.Nd display who is logged in
|
||||||
.SH SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.BR who
|
.Nm who
|
||||||
.RB [ am
|
.Op Ar am I
|
||||||
.BR I ]
|
.Op Ar file
|
||||||
.RI [ file ]
|
.Sh DESCRIPTION
|
||||||
.SH DESCRIPTION
|
|
||||||
The utility
|
The utility
|
||||||
.BR who
|
.Nm who
|
||||||
displays
|
displays
|
||||||
a list of all users currently logged on, showing for each user
|
a list of all users currently logged on, showing for each user
|
||||||
the login name,
|
the login name,
|
||||||
tty name, the date and time of login, and hostname if not local.
|
tty name, the date and time of login, and hostname if not local.
|
||||||
.LP
|
.Pp
|
||||||
Available options:
|
Available options:
|
||||||
.RS
|
.Pp
|
||||||
.IP "\fBam I\fR"
|
.Bl -tag -width file
|
||||||
|
.It Ar \&am I
|
||||||
Returns the invoker's real user name.
|
Returns the invoker's real user name.
|
||||||
.IP \fIfile\fR
|
.It Ar file
|
||||||
By default,
|
By default,
|
||||||
.BR who
|
.Nm who
|
||||||
gathers information from the file
|
gathers information from the file
|
||||||
.BR /var/run/utmp .
|
.Pa /var/run/utmp .
|
||||||
An alternate
|
An alternate
|
||||||
.BR file
|
.Ar file
|
||||||
may be specified which is usually
|
may be specified which is usually
|
||||||
.BR /var/run/wtmp
|
.Pa /var/run/wtmp
|
||||||
(or
|
(or
|
||||||
.BR /var/run/wtmp.[0-6]
|
.Pa /var/run/wtmp.[0-6]
|
||||||
depending on site policy as
|
depending on site policy as
|
||||||
.BR wtmp
|
.Pa wtmp
|
||||||
can grow quite large and daily versions may or may not
|
can grow quite large and daily versions may or may not
|
||||||
be kept around after compression by
|
be kept around after compression by
|
||||||
.BR ac (8)).
|
.Xr ac 8 ) .
|
||||||
The
|
The
|
||||||
.BR wtmp
|
.Pa wtmp
|
||||||
file contains a record of every login, logout,
|
file contains a record of every login, logout,
|
||||||
crash, shutdown and date change
|
crash, shutdown and date change
|
||||||
since
|
since
|
||||||
.BR wtmp
|
.Pa wtmp
|
||||||
was last truncated or
|
was last truncated or
|
||||||
created.
|
created.
|
||||||
.RE
|
.El
|
||||||
.LP
|
.Pp
|
||||||
If
|
If
|
||||||
.BR /var/log/wtmp
|
.Pa /var/log/wtmp
|
||||||
is being used as the file, the user name may be empty
|
is being used as the file, the user name may be empty
|
||||||
or one of the special characters '|', '}' and '~'. Logouts produce
|
or one of the special characters '|', '}' and '~'. Logouts produce
|
||||||
an output line without any user name. For more information on the
|
an output line without any user name. For more information on the
|
||||||
special characters, see
|
special characters, see
|
||||||
.BR utmp (5).
|
.Xr utmp 5 .
|
||||||
.SH FILES
|
.Sh FILES
|
||||||
.B /var/run/utmp
|
.Bl -tag -width /var/log/wtmp.[0-6] -compact
|
||||||
.br
|
.It Pa /var/run/utmp
|
||||||
.B /var/log/wtmp
|
.It Pa /var/log/wtmp
|
||||||
.br
|
.It Pa /var/log/wtmp.[0-6]
|
||||||
.B /var/log/wtmp.[0-6]
|
.El
|
||||||
.SH SEE ALSO
|
.Sh SEE ALSO
|
||||||
.BR last (1),
|
.Xr last 1 ,
|
||||||
.BR users (1),
|
.Xr users 1 ,
|
||||||
.BR getuid (2),
|
.Xr getuid 2 ,
|
||||||
.BR utmp (5)
|
.Xr utmp 5
|
||||||
.SH HISTORY
|
.Sh HISTORY
|
||||||
A
|
A
|
||||||
.BR who
|
.Nm
|
||||||
command appeared in Version 6 AT&T UNIX.
|
command appeared in
|
||||||
|
.At v6 .
|
||||||
|
|
|
@ -50,7 +50,7 @@ static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <utmp.h>
|
#include <utmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef __ORCAC__
|
#ifdef __GNO__
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -60,26 +60,18 @@ static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
|
||||||
static void output(struct utmp *up);
|
static void output(struct utmp *up);
|
||||||
static FILE *file(char *name);
|
static FILE *file(char *name);
|
||||||
|
|
||||||
#ifdef __ORCAC__
|
|
||||||
char *__progname = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
register char *p;
|
register char *p;
|
||||||
static struct utmp usr;
|
static struct utmp usr;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
#ifdef __ORCAC__
|
#ifdef __GNO__
|
||||||
FILE *ufp;
|
FILE *ufp;
|
||||||
char *t;
|
char *t;
|
||||||
#else
|
#else
|
||||||
FILE *ufp, *file();
|
FILE *ufp, *file();
|
||||||
char *t, *rindex(), *strcpy(), *strncpy(), *ttyname();
|
char *t, *rindex(), *strcpy(), *strncpy(), *ttyname();
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __ORCAC__
|
|
||||||
__progname = argv[0];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
|
@ -133,7 +125,7 @@ static char buf[80];
|
||||||
|
|
||||||
(void)printf("%-*.*s %-*.*s", UT_NAMESIZE, UT_NAMESIZE, up->ut_name,
|
(void)printf("%-*.*s %-*.*s", UT_NAMESIZE, UT_NAMESIZE, up->ut_name,
|
||||||
UT_LINESIZE, UT_LINESIZE, up->ut_line);
|
UT_LINESIZE, UT_LINESIZE, up->ut_line);
|
||||||
#ifdef __ORCAC__
|
#ifdef __GNO__
|
||||||
sprintf(buf, "%s", asctime(localtime(&up->ut_time)));
|
sprintf(buf, "%s", asctime(localtime(&up->ut_time)));
|
||||||
#else
|
#else
|
||||||
(void)strftime(buf, sizeof(buf), "%c", localtime(&up->ut_time));
|
(void)strftime(buf, sizeof(buf), "%c", localtime(&up->ut_time));
|
||||||
|
@ -147,10 +139,10 @@ static char buf[80];
|
||||||
static FILE *
|
static FILE *
|
||||||
file(char *name)
|
file(char *name)
|
||||||
{
|
{
|
||||||
extern int errno;
|
extern int errno;
|
||||||
FILE *ufp;
|
FILE *ufp;
|
||||||
#ifndef __ORCAC__
|
#ifndef __GNO__
|
||||||
char *strerror();
|
char *strerror();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!(ufp = fopen(name, "r"))) {
|
if (!(ufp = fopen(name, "r"))) {
|
||||||
|
|
9
usr.bin/who/who.desc
Normal file
9
usr.bin/who/who.desc
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Name: who
|
||||||
|
Version: 1.0 (October 1997)
|
||||||
|
Shell: GNO
|
||||||
|
Author: Derek Taubert (from FreeBSD 2.1.0 code)
|
||||||
|
Contact: taubert@geeks.org
|
||||||
|
Where: /usr/bin
|
||||||
|
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
|
||||||
|
|
||||||
|
Display users on the system.
|
31
usr.bin/who/who.rez
Normal file
31
usr.bin/who/who.rez
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* Resources for who version and comment
|
||||||
|
*
|
||||||
|
* $Id: who.rez,v 1.1 1998/01/25 23:36:30 taubert Exp $
|
||||||
|
*/
|
||||||
|
#define PROG "who"
|
||||||
|
#define DESC "Display users on the system."
|
||||||
|
|
||||||
|
#include "Types.rez"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Version
|
||||||
|
*/
|
||||||
|
resource rVersion (1, purgeable3) {
|
||||||
|
{ 1, 0, 0, /* Version 1.0.0 */
|
||||||
|
release, /* development|alpha|beta|final|release */
|
||||||
|
0 }, /* non-final release number */
|
||||||
|
verUS, /* Country */
|
||||||
|
PROG, /* Program name */
|
||||||
|
DESC " Released with GNO/ME."
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Comment
|
||||||
|
*/
|
||||||
|
resource rComment (1, purgeable3) {
|
||||||
|
PROG " v1.0 (October 1997)\n"
|
||||||
|
"GNO utility: " DESC "\n"
|
||||||
|
"Ported from FreeBSD 2.1.0 code by Derek Taubert."
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user