shithub: riscv

Download patch

ref: 89500cba40332128f191a2403ea2c1b7c647d5e8
parent: cebce1be70fbc8a5afd94909504e937be5b59b9d
author: aiju <[email protected]>
date: Sun Jun 26 10:15:14 EDT 2011

added /proc/*/ppid

--- a/sys/src/9/port/devproc.c
+++ b/sys/src/9/port/devproc.c
@@ -23,6 +23,7 @@
 	Qnoteid,
 	Qnotepg,
 	Qns,
+	Qppid,
 	Qproc,
 	Qregs,
 	Qsegment,
@@ -87,6 +88,7 @@
 	"noteid",	{Qnoteid},	0,			0664,
 	"notepg",	{Qnotepg},	0,			0000,
 	"ns",		{Qns},		0,			0444,
+	"ppid",		{Qppid},	0,			0444,
 	"proc",		{Qproc},	0,			0400,
 	"regs",		{Qregs},	sizeof(Ureg),		0000,
 	"segment",	{Qsegment},	0,			0444,
@@ -417,6 +419,7 @@
 	case Qregs:
 	case Qfpregs:
 	case Qsyscall:	
+	case Qppid:
 		nonone(p);
 		break;
 
@@ -963,6 +966,8 @@
 
 	case Qnoteid:
 		return readnum(offset, va, n, p->noteid, NUMSIZE);
+	case Qppid:
+		return readnum(offset, va, n, p->parentpid, NUMSIZE);
 	case Qfd:
 		return procfds(p, va, n, offset);
 	}