Tuesday, June 5, 2012

Wait in Unix

The purpose of the wait API function is to suspend the calling process until the child process exits or until a signal is delivered.
If the parent isn't currently waiting on the child to exit, the child exit , and the child process becomes a zombie process.

The prototype for the wait function is defined as :

pid_t wait(int *status)

The status variable returns status information about the child exit. This variable can be evaluated using a number of macros. Like :

1. WIFEXITED: Non zero if the child exited normally.
2.WEFSIGNALED : Return true if child exited due to a signal that wasn't caught by the child.
3. WTERMSIG : Return the signal number that caused the child to exit.
4.WEXITSTATUS : Return the exit status of the child .

No comments:

Post a Comment

Qualcomm Short Term

  113 is the SL. 1st Target by mid July.

Total Pageviews