Browse Source

Plan 9 from Bell Labs 2013-06-15

David du Colombier 11 years ago
parent
commit
9851b5ba32
3 changed files with 23 additions and 2 deletions
  1. 4 0
      sys/man/3/proc
  2. 13 0
      sys/man/4/rdbfs
  3. 6 2
      sys/src/cmd/rdbfs.c

+ 4 - 0
sys/man/3/proc

@@ -170,6 +170,10 @@ If the process has no extant children, living or exited,
 a read of
 .B wait
 will block.
+If the file's length is non-zero
+(see
+.IR stat (2)),
+there is at least one wait record to read.
 It is an error for a process to attempt to read its own
 .B wait
 file when it has no children.

+ 13 - 0
sys/man/4/rdbfs

@@ -11,6 +11,10 @@ rdbfs \- remote kernel debugging file system
 .I pid
 ]
 [
+.B -s
+.I srvname
+]
+[
 .B -t
 .I text
 ]
@@ -28,6 +32,15 @@ a kernel over the serial line
 .I device
 (default 
 .BR /dev/eia0 ).
+If the
+.B -s
+option is given,
+.I rdbfs
+will post its channel in
+.BI /srv/ srvname
+(see
+.IR srv (3)),
+allowing the session to be shared or reattached later.
 .PP
 The 
 .B text

+ 6 - 2
sys/src/cmd/rdbfs.c

@@ -137,12 +137,13 @@ Biobuf	rfb;
 char*	portname = "/dev/eia0";
 char*	textfile = "/386/9pc";
 char*	procname = "1";
+char*	srvname;
 Channel* rchan;
 
 void
 usage(void)
 {
-	fprint(2, "usage: rdbfs [-p procnum] [-t textfile] [serialport]\n");
+	fprint(2, "usage: rdbfs [-p procnum] [-s srvname] [-t textfile] [serialport]\n");
 	exits("usage");
 }
 
@@ -397,6 +398,9 @@ threadmain(int argc, char **argv)
 	case 'p':
 		procname = EARGF(usage());
 		break;
+	case 's':
+		srvname = EARGF(usage());
+		break;
 	case 't':
 		textfile = EARGF(usage());
 		break;
@@ -427,7 +431,7 @@ threadmain(int argc, char **argv)
 	for(i=0; i<nelem(tab); i++)
 		closefile(createfile(dir, tab[i].s, "rdbfs", tab[i].mode, (void*)tab[i].id));
 	closefile(dir);
-	threadpostmountsrv(&fs, nil, "/proc", MBEFORE);
+	threadpostmountsrv(&fs, srvname, "/proc", MBEFORE);
 	exits(0);
 }