SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to recognize which child process has just ended?

    Hi!

    The piece of software I'm working on now needs to fork child processes and execute different programs (which terminate themselves). Also, some child processes need to be killed/stopped/resumed and action needs to be taken when a child is terminated. When the parent receives & traps the SIGCLD signal, how does it know which child it is regarding and whether it has been ended, terminated, stopped or resumed?

    In brief, I need the information, which in C signal handling is accessible via the siginfo_t structure.

    Thanks.

  2. #2
    Web developer Carl's Avatar
    Join Date
    Sep 2003
    Location
    sweden
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First you want to use a fork call to start a subprocess because it returns a process ID. When you issue a process.wait call it looks at the pipe and checks on the status of the process via it's ID.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •