0

I am writing an extensible shell am I am working on an issue related to catching SIGCHLD signals from a Unix kernel.

I am trying to maintain a list of current jobs (so when the user types "jobs" into the shell I can return the appropriate jobs). The issue arises when I need to remove jobs from the list. I'd like to remove them from the list when I receive a SIGCHLD signal letting me know the process is terminated.

There are two issues: 1. When I receive a SIGCHLD signal, how do I know which child sent that signal? 2. How do I deal if multiple SIGCHLD signals are received and they do not get queued so I'll only see the first SIGCHLD return?

Thank you!

Rich Episcopo
  • 499
  • 1
  • 5
  • 17
  • Refer to this post, this answers your first question http://stackoverflow.com/questions/2595503/determine-pid-of-terminated-process – user376507 Feb 13 '14 at 20:26
  • 1
    @user376507: It actually answers both questions. Good find. Marked as dup. – rici Feb 13 '14 at 20:26

0 Answers0