9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Fco.J.Ballesteros <nemo@plan9.escet.urjc.es>
To: 9fans@cse.psu.edu
Subject: [9fans] who command for fossil
Date: Fri, 14 Mar 2003 09:49:58 +0100	[thread overview]
Message-ID: <d5e5d435d8364e210cca032414c4cd7d@plan9.escet.urjc.es> (raw)

I find this useful to know who's using the fossil before rebooting it.


diff /n/dump/2003/0314/sys/src/cmd/fossil /sys/src/cmd/fossil
diff /n/dump/2003/0314/sys/src/cmd/fossil/9proc.c /sys/src/cmd/fossil/9proc.c
732a733,763
> static int
> cmdWho(int argc, char* argv[])
> {
> 	Con *con;
> 	Fid *fid, *hash;
> 	char *usage = "usage: who";
> 	int	i;
> 
> 	ARGBEGIN{
> 	default:
> 		return cliError(usage);
> 	}ARGEND;
> 
> 	if (argc > 0)
> 		return cliError(usage);
> 	vtRLock(cbox.clock);
> 	for(con = cbox.chead; con != nil; con = con->cnext){
> 		consPrint("\t%s\n", con->name);
> 		vtLock(con->fidlock);
> 		for (i = 0; i < NFidHash; i++){
> 			hash = con->fidhash[i];
> 			for(fid = hash; fid != nil; fid = fid->hash)
> 				if(fid->fidno != NOFID && fid->uname != nil)
> 				consPrint("\t\t%d: %s\n", fid->fidno, fid->uname);
> 		}
> 		vtUnlock(con->fidlock);
> 	}
> 	vtRUnlock(cbox.clock);
> 	return 1;
> }
> 
744a776
> 	cliAddCmd("who", cmdWho);

diff /n/dump/2003/0314/sys/man/8/fossilcons /sys/man/8/fossilcons
261a262,263
> .PP
> .B who
836a839,842
> .PP
> .I Who
> prints the set of active fids for each connection along with
> the user name for each fid.



                 reply	other threads:[~2003-03-14  8:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5e5d435d8364e210cca032414c4cd7d@plan9.escet.urjc.es \
    --to=nemo@plan9.escet.urjc.es \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).