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);
  ...
}

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.