Thread: How to get child pids from parent pid in linux kernel mode?

  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    1

    How to get child pids from parent pid in linux kernel mode?

    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

  2. #2
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Register to the parent via the child and pass the pid of the child to the parent.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    The 'ps' command seems to know a lot about the parent/child relationship of all processes.

    Perhaps study the source code of that?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Delete Binary Tree Node
    By matrixx333 in forum C Programming
    Replies: 4
    Last Post: 11-30-2009, 12:39 AM
  2. SIGNAL Suspended?
    By Victor_November in forum C Programming
    Replies: 11
    Last Post: 11-10-2009, 11:55 PM
  3. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  4. User mode and Kernel Mode
    By learner01 in forum Linux Programming
    Replies: 9
    Last Post: 08-10-2006, 08:20 PM
  5. User mode and Kernel mode
    By learner01 in forum C++ Programming
    Replies: 7
    Last Post: 08-09-2006, 02:38 PM

Tags for this Thread