added /proc/*/ppid

aiju 2011-06-26 14:15:14 +02:00
parent cebce1be70
commit 89500cba40
1 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,7 @@ enum
Qnoteid, Qnoteid,
Qnotepg, Qnotepg,
Qns, Qns,
Qppid,
Qproc, Qproc,
Qregs, Qregs,
Qsegment, Qsegment,
@ -87,6 +88,7 @@ Dirtab procdir[] =
"noteid", {Qnoteid}, 0, 0664, "noteid", {Qnoteid}, 0, 0664,
"notepg", {Qnotepg}, 0, 0000, "notepg", {Qnotepg}, 0, 0000,
"ns", {Qns}, 0, 0444, "ns", {Qns}, 0, 0444,
"ppid", {Qppid}, 0, 0444,
"proc", {Qproc}, 0, 0400, "proc", {Qproc}, 0, 0400,
"regs", {Qregs}, sizeof(Ureg), 0000, "regs", {Qregs}, sizeof(Ureg), 0000,
"segment", {Qsegment}, 0, 0444, "segment", {Qsegment}, 0, 0444,
@ -417,6 +419,7 @@ procopen(Chan *c, int omode)
case Qregs: case Qregs:
case Qfpregs: case Qfpregs:
case Qsyscall: case Qsyscall:
case Qppid:
nonone(p); nonone(p);
break; break;
@ -963,6 +966,8 @@ procread(Chan *c, void *va, long n, vlong off)
case Qnoteid: case Qnoteid:
return readnum(offset, va, n, p->noteid, NUMSIZE); return readnum(offset, va, n, p->noteid, NUMSIZE);
case Qppid:
return readnum(offset, va, n, p->parentpid, NUMSIZE);
case Qfd: case Qfd:
return procfds(p, va, n, offset); return procfds(p, va, n, offset);
} }