Re: wrong hardlink count for /proc/PID directories

From: Jan Engelhardt
Date: Wed Dec 22 2004 - 17:43:43 EST

>Tested on some 2.6.[7-9] kernels: a stat call for a /proc/SOMEPID
>directory returns a hard link count of 3, which is invalid, since these
>directories have three subdirectories (attr, fd and task) and hence the hard
>link counter should be 5.
>This causes at least 'find' (gnu findutils) to malfunction, it does not
>descend under /proc/SOMEPID/fd and /proc/SOMEPID/attr. See also:

You could try working around this by using -noleaf. (Which is by no means a

Hm, I have 2.6.8+.9-rc2, and /proc/1 for example has a link count of 3 which
seems reasonable: ".", "fd" and "task".

Jan Engelhardt
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at