Include unistdh pid t getpgrpvoid returns process

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the PID of the terminated child that caused waitpid to return, and the terminated child is removed from the system. Determining the Members of the Wait Set The members of the wait set are determined by the pid argument: ¯ ¯ If pid > 0, then the wait set is the singleton child process whose process ID is equal to pid. If pid = -1, then the wait set consists of all of the parent’s child processes. Aside: Waiting on sets of processes. The waitpid function also supports other kinds of wait sets, involving Unix process groups, that we will not discuss. End Aside. Modifying the Default Behavior The default behavior can be modified by setting options to various combinations of the WNOHANG and WUNTRACED constants: ¯ ¯ ¯ WNOHANG: Return immediately (with a return value of 0) if the none of the child processes in the wait set has terminated yet. WUNTRACED: Suspend execution of the calling process until a process in the wait set becomes terminated or stopped. Return the PID of the terminated or stopped child that caused the return. WNOHANG|WUNT...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online