Wait():
Header file: #include <sys/wait.h>
Prototype: pid_t wait(int *stat_loc);
The wait system call causes a parent process to pause until one of its child processes is stopped. The call returns the PID of the child process. This will normally be a child process that has terminated. The status information allows the parent process to determine the exit status of the child process, that is, the value returned from main or passed to exit. If stat_loc is not a null pointer, the status information will be written to the location to which it points.
Pause():
Header: #include <unistd.h>
Prototype: int pause(void);
pause system call,simply causes the program to suspend execution until a signal occurs. When it receives a signal, any established handler is run and execution continues as normal.
on error it returns -1 (if the next received signal doesn’t cause the program to terminate) with errno set to EINTR when interrupted by a signal.
For more information: read man pages
Comments
Post a Comment
https://gengwg.blogspot.com/