If the child process ends before the parent process, the parent process calls the wait () function and does not call the wait () function to produce two different results: -- if the parent process does not call wait () and waitpid () function, the
From: http://hi.baidu.com/wlzqi/blog/item/208cebc4b1c02dab8326ac79.html
The wait function is prototype: # Include/* define the pid_t type */# IncludePid_t wait (int * Status) Once a process calls wait, it immediately blocks itself. Wait
If a child process is preceded by a parent process, the wait () function is invoked by the parent process and the wait () function is not invoked to produce two different results:--> If the parent process does not invoke the wait () and the Waitpid (
Man Wait:
NameWait, waitpid, waitid-wait for process to change state
Synopsis# Include # Include
Pid_t wait (int * status );
Pid_t waitpid (pid_t PID, int * status, int options );
Int waitid (idtype_t idtype, id_t ID, siginfo_t * INFOP, int options
Discovery process-related programming problem contains the amount of knowledge is really too large, this is about wait and waitpid difference, previously just roughly know their differences, this is the comparison of the Internet to see the
The function prototype for wait is:
#include
#include
pid_t Wait (int *status)
Once the process has called wait, immediately block yourself, by wait to automatically analyze whether a subprocess of the current process has exited, if it finds such
the function prototypes for wait are:#include #include pid_t Wait (int *status)Once the process has called wait, it immediately blocks itself, and the wait automatically parses if a child process of the current process has exited, and if it finds
1.8 wait
1.8.1 Overview
The wait function is prototype:
# Include /* define the pid_t type */# Include Pid_t wait (int * Status)
Once a process calls wait, it immediately blocks itself. Wait automatically analyzes
Author: LxmuyuLinks: Wait, waitpidWait1.1 IntroductionThe wait function requires a header file:#include #include Wait function prototype:pid_t Wait (int *status);Once the process has called wait, it immediately blocks itself, and the wait
#include /*provides a definition of type pid_t*/#includepid_t Wait (int*status) Once the process has called wait, it blocks itself immediately, and the wait automatically parses if a child process of the current process has exited, and if it finds
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.