9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Oh, I almost forgot...
@ 2003-02-27 17:08 Dan Cross
  0 siblings, 0 replies; only message in thread
From: Dan Cross @ 2003-02-27 17:08 UTC (permalink / raw)
  To: 9fans; +Cc: 9trouble

In changing around newns(), I added a command to help in debugging.  It's
turned out to be fairly useful generally, and I've installed it as auth/newns.
Here's the source:

	- Dan C.

#include <u.h>
#include <libc.h>
#include <auth.h>

void
usage(void)
{
	fprint(2, "Usage: newns [ -f file ] command.\n");
	exits("usage");
}

void
main(int argc, char *argv[])
{
	char	*nsfile;

	nsfile = "/lib/namespace";
	ARGBEGIN {
	case 'f':
		nsfile = ARGF();
		break;
	default:
		usage();
		break;
	} ARGEND
	if (argc == 0)
		usage();
	newns(getuser(), nsfile);
	exec(argv[0], argv);
	sysfatal("exec: %s: %r", argv[0]);
}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-27 17:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-27 17:08 [9fans] Oh, I almost forgot Dan Cross

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).