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

This is a discussion on How to get child pids from parent pid in linux kernel mode? within the Linux Programming forums, part of the Platform Specific Boards category; hi , i need C code to get child pids from its parent pid in linux and in 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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,751
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 10:24 AM
  4. User mode and Kernel Mode
    By learner01 in forum Linux Programming
    Replies: 9
    Last Post: 08-10-2006, 09:20 PM
  5. User mode and Kernel mode
    By learner01 in forum C++ Programming
    Replies: 7
    Last Post: 08-09-2006, 03:38 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21