We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,692 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

getting terminated process id in handler

how do i get the child id without calling wait? is there a way to put wait information back so another waitpid can get it...?

void sigchld_handler(int signo) {
  pid_t p = wait(NULL);
  ...
}
2
Contributors
1
Reply
8 Hours
Discussion Span
3 Years Ago
Last Updated
2
Views
coconauts
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

AFAIK, you can only wait for each child exactly once.

The process 'stub' the OS keeps around between the end of the child to hold the information you get with 'wait' calls will disappear as soon as that information is delivered to you.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,875
Solved Threads: 953
Skill Endorsements: 26

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0526 seconds using 2.67MB