lkml.org 
[lkml]   [1996]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: proc fs and shared pids
Date
From
>Kernelthreads? They dont shre the same pid. Userthreads are not visible to
>the kernel at all and therefore there is no proc entry.

As I understand it, kernel threads are implemented in linux with
clone(), and hence they *can* share the same PID. Whether this
is a good idea is perhaps another matter.

Just did some experimenting with clone() and the CLONE_PID flag.

This creates a new process with the same process ID as the original
process. The proc fs has two directory entries for this with the same
i-number. (!) So I guess the status of one of the two processes can never
be retrieved.

IMHO this is yet another severe shortcoming of /proc. It would perhaps
be better to create a device which you can read and then returns the
status of all processes. I just wrote a module that does exactly that.
--
Michiel Boland <boland@sci.kun.nl>
University of Nijmegen
The Netherlands


\
 
 \ /
  Last update: 2005-03-22 13:38    [from the cache]
©2003-2011 Jasper Spaans