The attached patch fixes a problem in /proc that was seen in 2.4.20 but seems applicable to 2.4.x. It is possible for a process to be scanning /proc for processes and to access a cached task_struct pointer (via the /proc list entry) even though the associated process is dying/dead - and the /proc list entry has not yet been removed. The /proc code detects this (via task PID equal to zero) and currently returns EINVAL which is confusing at best. Since it is entirely possible for a /proc user to encounter ENOENT on lookup/traverse at any time this patch changes the returned status to ENOENT when the task PID is zero. Adding locking seemed like overkill. mark P.S. One could argue that the EINVAL should really be ENOMEM in this case. Perhaps this should also be discussed?