📄 wait.2
字号:
.TH WAIT 2 .SH NAMEwait \- wait for process to terminate.SH SYNOPSIS.B wait(status).br.B int *status;.PP.B wait(0).SH DESCRIPTION.I Waitcauses its caller to delay until a signal is received orone of its childprocesses terminates.If any child has died since the last.I wait,return is immediate;if there are no children, return is immediate withthe error bit set(resp. with a value of \-1 returned).The normal return yields the process ID of the terminated child.In the case of several children several.I waitcalls are neededto learn of all the deaths..PPIf.RI (int) statusis nonzero, the high byte of the word pointed toreceives the low byte of theargument of.I exitwhen the child terminated.The low bytereceives the termination statusof the process.See.IR signal (2)for a list of termination statuses (signals);0 status indicates normal termination.A special status (0177) is returned for a stopped processwhich has not terminated and can be restarted.See.IR ptrace (2).If the 0200 bit of the termination statusis set,a core image of the process was producedby the system..PPIf the parent process terminates withoutwaiting on its children,the initialization process(process ID = 1)inherits the children..SH "SEE ALSO"exit(2), fork(2), signal(2).SH DIAGNOSTICSReturns\-1 if there are no children not previously waited for..SH ASSEMBLER(wait = 7.).br.B sys wait.br(process ID in r0).br(status in r1).PPThe high byte of the status isthe low byte of r0 in the child at termination.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -