From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <036c01c423a7$21a3f3c0$57d87d50@SOMA> From: "boyd, rounin" To: <9fans@cse.psu.edu> References: Subject: Re: [9fans] waitpid() MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Fri, 16 Apr 2004 13:36:38 +0200 Topicbox-Message-UUID: 5d2c710c-eacd-11e9-9e20-41e7f4b1d025 > So the big question is whether it is entirely out of the question to > enhance the kernel "wait" functionality so that something resembling > Posix waitpid() can return the termination information for a chosen > PID. don't do it in kernel mode. do it in user mode. just record the pid + Waitmsg of the ones that wait has returned and search this first and if not found go into a wait loop, recording the pid + Waitmsg as wait returns if it's not the one you want, otherwise return. The Waitmsg structure is allocated by malloc(2) and should be freed after use. For programs that only need the pid of the exiting program, waitpid returns just the pid and discards the rest of the information. http://plan9.bell-labs.com/magic/man2html/2/wait