PDA

View Full Version : How to get child pids from parent pid in linux kernel mode?



epezhman
06-28-2010, 02:29 PM
hi , i need C code to get child pids from its parent pid in linux and in kernel mode, is there anything like getpid() or getppid() which works in kernel mode? can you suggest ant trick how to do this. thanks

Kennedy
06-28-2010, 07:55 PM
Register to the parent via the child and pass the pid of the child to the parent.

Salem
06-28-2010, 10:17 PM
The 'ps' command seems to know a lot about the parent/child relationship of all processes.

Perhaps study the source code of that?