GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
WAIT(2) FreeBSD System Calls Manual WAIT(2)

̾??

wait, waitpid, wait4, wait3?ץ??????ν?λ?Ե?

Standard C Library (libc, -lc)

<sys/types.h> <sys/wait.h> pid_t (int *status) <sys/time.h> <sys/resource.h> pid_t waitpid(pid_t wpid, int *status, int options) pid_t wait3(int *status, int options, struct rusage *rusage) pid_t wait4(pid_t wpid, int *status, int options, struct rusage *rusage)

wait() ?ؿ??ϡ???λ?????ҥץ??????? status ???󤬻??ѤǤ????褦?ˤʤ??ޤǡ??ޤ??ϥ????ʥ????????????ޤǡ? ?ƤӽФ??ץ??????μ¹Ԥ????ߤ??ޤ??? wait() ?ƤӽФ????????????ȡ? status ?ΰ??ˤϲ????????Τ褦?˽?λ?????ץ??????ν?λ???????????ޤ???

() ?????ƥॳ?????ϡ??????λҥץ????????Ԥ?ɬ?פ????ꡢ?ҥץ??????????Ѥ??? ?꥽???????????פ??뤤?ϥ??ץ???????ɬ?פȤ????ץ????????Τ????ˡ? ????????Ū?ʥ??󥿥ե????????󶡤??ޤ??? ????¾???Ե??ؿ??ϡ? wait4() ?????Ѥ??Ƽ????????Ƥ??ޤ???

wpid ???????ԤĤ٤??ҥץ??????ν????????ꤷ?ޤ??? wpid ?? -1 ?Ǥ??????硢???θƤӽФ??Ϥ??٤Ƥλҥץ????????Ԥ??ޤ??? wpid ?? 0 ?Ǥ??????硢???θƤӽФ??ϡ??ƤӽФ?¦?Υץ????????롼?פ? ???٤Ƥλҥץ????????Ԥ??ޤ??? wpid ?? 0 ?????礭?????硢???θƤӽФ??ϥץ????? ID ?? wpid ?Ǥ????ץ????????Ԥ??ޤ??? wpid ?? -1 ???꾮???????硢?ƤӽФ??ϡ??ץ????????롼?? ID ?? wpid ???????ͤ????????ץ????????Ԥ??ޤ???

status ?????ϡ??ʲ??Τ褦???????????Ƥ??ޤ??? options ?????ˤϡ??ʲ???Ǥ?դΥ??ץ??????Υӥå??????¤??????ޤ??? WCONTINUED ???ץ??????ϡ????????ȥץ??????λҥץ??????ǡ????????????????߾??֤??? SIGCONT ?????ʥ??????????ä??????????ץ??????Υ??ơ??????? ???𤹤??٤??Ǥ??뤳?Ȥ򼨤??ޤ??? WNOHANG ???ץ??????ϡ????ơ??????????𤹤??ץ????????ʤ??????˸ƤӽФ??? ?֥??å????ʤ????Ȥ򼨤??????˻??Ѥ??ޤ??? WUNTRACED ???ץ??????????ꤹ???ȡ? SIGTTIN, SIGTTOU, SIGTSTP, SIGSTOP ?????ʥ??Τ????????ߤ??????????ȥץ??????λҤˤ⡢ ???Υ??ơ??????????𤵤??ޤ???

rusage ?? 0 ?ʳ??Ǥ????????ϡ???λ?????ץ??????? ???Τ??٤ƤλҤ????Ѥ????꥽?????Υ??ޥ꤬?֤????ޤ? (???ߤΤȤ????????ξ????????ߤ????ץ??????ˤĤ??Ƥϻ??ѤǤ??ޤ???)??

WNOHANG ???ץ????󤬻??ꤵ?졢???ơ??????????𤹤??ץ????????ʤ????硢 () ?ϥץ????? ID 0 ???ᤷ?ޤ???

() ?ؿ??ϡ? rusage ???ͤ? 0 ?ˤ??? wait4() ??Ʊ???Ǥ??? ?Ť? wait3() ?ƤӽФ??ϡ? wpid ???ͤ? -1 ?ˤ??? wait4() ??Ʊ???Ǥ???

?ʲ??Υޥ????ϡ??ץ??????ν?λ?λ??????Τ??Τ˻??ѤǤ??ޤ??? ?ǽ??? 3 ?ĤΥޥ????ϡ?0 ?ʳ? (??) ???ͤ?ɾ?????ޤ?:

(status)
?ץ?????????λ???Ƥ??餺?????????????????߾??֤Τ????????????????? ???Ȥʤ??ޤ??? ???Υޥ????? wait ?ƤӽФ??? WCONTINUED ???ץ????󤬻??ꤵ?줿?????Τ߿??Ȥʤ??ޤ???
(status)
_exit(2) ?? exit(3) ???ƤӽФ????ץ????????????˽?λ?????????˿??Ȥʤ??ޤ???
(status)
?????ʥ????????????????˥ץ?????????λ?????????˿??Ȥʤ??ޤ???
(status)
?ץ?????????λ???Ƥ??ʤ????????ߤ??Ƥ??ƺƳ??Ǥ????????˿??Ȥʤ??ޤ??? ???Υޥ????? wait ?ƤӽФ??? WUNTRACED ???ץ??????????ꤹ?뤫???ҥץ????????ȥ졼???????Ƥ??? (ptrace(2) ?򻲾?) ?????Τߤ˿??Ȥʤ??ޤ???

?嵭?ޥ??????ͤ˽??äơ??ʲ??Υޥ????ϡ? ?ҥץ??????λĤ??Υ??ơ??????????????????ޤ?:

(status)
(status) ?????Ǥ????????ˡ??Ҥ? _exit(2) ?? exit(3) ???Ϥ????????β??? 8 ?ӥåȤ?ɾ?????ޤ???
(status)
WIFSIGNALED(status) ?????Ǥ????????ˡ??ץ??????ν?λ?θ????Ȥʤä??????ʥ????ֹ???ɾ?????ޤ???
(status)
WIFSIGNALED(status) ?????Ǥ????????ˡ??ץ?????????λ???????ǡ??????ʥ????????????Ȥ??? ?ץ??????Υ??᡼?????ޤॳ???ե????뤬???????줿?????˿??Ȥʤ??ޤ???
(status)
WIFSTOPPED(status) ?????Ǥ????????ˡ??ץ??????????ߤθ????Ȥʤä??????ʥ????ֹ???ɾ?????ޤ???

??λ?????ʥ??Υꥹ?ȤˤĤ??Ƥϡ? sigaction(2) ?򻲾Ȥ??Ƥ????????? ???ơ??????? 0 ?Ǥ????Ȥ??????Ȥϡ??????˽?λ?????Ȥ??????ȤǤ???

???٤Ƥλҥץ??????ν?λ???Ԥ????˿ƥץ?????????λ?????ȡ? ?Ĥ??λҥץ??????ˤϿƥץ????? ID ?? 1 (init ?Υץ????? ID) ?? ???????Ƥ????ޤ???

Ǥ?դ? () ?ƤӽФ?????α?ˤʤäƤ????֤˥????ʥ????????????ȡ? ?????ʥ??????롼?????????ä??Ȥ??ˡ? ?ƤӽФ??ϳ??????ޤ??뤫?Ƴ??????ޤ??? ?????ϥ????ʥ??˱ƶ????륪?ץ??????˰?¸???ޤ??? intro(2) ?????ƥॳ?????κƳ? (System call restart) ?ι??ܤ򻲾Ȥ??Ƥ?????????

?ҥץ??????????ߤ???????λ?????????? wait() ?????ä??????ϡ??ҤΥץ????? ID ???ƤӽФ?¦?ץ????????ᤵ???ޤ??? ????¾?ξ????? -1 ???ᤵ?졢 errno ?????顼?򼨤??褦?????ꤵ???ޤ???

?ҥץ??????????ߤ???????λ?????????? (), (), waitpid() ?????ä??????ϡ??ҤΥץ????? ID ???ƤӽФ?¦?ץ????????ᤵ???ޤ??? ?ޤ? wait ?????Ƥ??ʤ??ҥץ???????¸?ߤ??ʤ??????ϡ?-1 ???ᤵ???? errno ?? ECHILD ?????ꤵ???ޤ??? WNOHANG ?????ꤵ?졢???ߤ????Ҥޤ??Ͻ?λ?????Ҥ??ʤ??????? 0 ???ᤵ???ޤ??? ???顼?????Ф????뤫???????????ʥ??ˤ??ꤳ?θƤӽФ????۾ェλ?????????ϡ? -1 ???ᤵ?졢 errno ?????顼?򼨤??褦?????ꤵ???ޤ???

wait() ?ؿ??ϰʲ??ξ????˥??顼?Ȥʤꡢ?????????????ޤ?:

[ECHILD]
?ƤӽФ?¦?ץ??????ϡ?wait ?????Ƥ??ʤ??ҥץ????????????ޤ?????
[ECHILD]
?????ʥ? SIGCHLD ??̵?뤹?뤳?ȡ??ޤ??Ϥ??Υ????ʥ??? SA_NOCLDWAIT ?ե饰?????ꤹ?뤳?Ȥˤ??ꡢ?ƤӽФ?¦?Υץ??????ϴ??˥????ƥ??? ???Τ褦???????ͤ??Ѵ??????褦???׵ᤷ?Ƥ????Τǡ? ??λ???줿?ҥץ????????????????ͤ?̵?????Ȥ???ǽ?Ǥ???
[EFAULT]
status ?????? rusage ????????ˡ?ʥ??ɥ쥹???ؤ??Ƥ??ޤ??? (?ҥץ??????ν?λ???ˤϸ??Ф????ʤ????Ȥ??????ޤ???)
[EINTR]
?ƤӽФ????????????ʥ??ˤ??äƳ??????ޤ줿?????????ʥ??? SA_RESTART ?ե饰?????ꤵ???Ƥ??ޤ?????

wait() ?ؿ??? waitpid() ?ؿ??? POSIX ?ˤ??ä??????????Ƥ??ޤ??? wait4() ?? wait3() ?? POSIX ?λ??ͤǤϤ????ޤ????? WCOREDUMP() ?ޥ???????????α???? wait() ?ƤӽФ????Ƴ????뵡ǽ?? POSIX ???󥿥ե??????γ?ĥ??ǽ?Ǥ???

??Ϣ????

_exit(2), ptrace(2), sigaction(2), exit(3)

wait() ?ؿ??ϡ? Version 6 AT&T UNIX ???о줷?ޤ?????

April 19, 1994 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 2 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.