[K42-discussion] process linux getfirst/next pid patch
Muli Ben-Yehuda
muli at il.ibm.com
Sat Sep 16 07:58:44 EST 2006
On Fri, Sep 15, 2006 at 02:39:35PM -0700, Patrick Bozeman wrote:
> Enable enumeration of ProcessLinux pids.
> diff -ru kitchsrc.orig/os/servers/baseServers/ProcessLinuxServer.C kitchsrc/os/servers/baseServers/ProcessLinuxServer.C
> --- kitchsrc.orig/os/servers/baseServers/ProcessLinuxServer.C 2006-02-28 08:59:32.000000000 -0800
> +++ kitchsrc/os/servers/baseServers/ProcessLinuxServer.C 2006-09-15 14:25:04.000000000 -0700
> @@ -1164,6 +1164,91 @@
[snippage]
> +/* virtual */ SysStatus
> +ProcessLinuxServer::_getNextPID(__inout pid_t& pid)
> +{
> + AutoLock<BLock> as(&taskLock);
> + task_struct *p;
> + uval index;
> +
> + // locate the chain on which the restart should run on.
> + index = pid_hashfn(pid);
> + p = pidhash[index];
> +
> + // Search hash chain that the pid should be on
> + if (p) {
> + while (p) {
The if does not appear to be necessary.
Cheers,
Muli
More information about the K42-discussion
mailing list