File:  [XINU] / xinu / sys / shell / x_who.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:04 2018 UTC (8 years, 3 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* x_who.c - x_who */

#include <conf.h>
#include <kernel.h>
#include <date.h>
#include <shell.h>

/*------------------------------------------------------------------------
 *  x_who  -  (command who) print name user is logged in under
 *------------------------------------------------------------------------
 */
COMMAND	x_who(stdin, stdout, stderr)
int	stdin, stdout, stderr;
{
	char	machine[32];
	char	str[80];

	if (marked(Shl.shmark) && Shl.shused) {
		getname(machine);
		sprintf(str, "%10s!%-10s Console : ", machine, Shl.shuser);
		write(stdout, str, strlen(str));
		ascdate(ut2ltim(Shl.shlogon), str);
		strcat(str, "\n");
		write(stdout, str, strlen(str));
	}
	return(OK);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.