📄 wait.2
字号:
1829(the)S2008(call)S(should)267 2210 A2533(not)S2717(block)S2996(if)S3114(there)S3372(are)S3552(no)S3708(processes)S4150(that)S4357(wish)S4603(to)S4736(report)S5032(status)S3552 V(\(WNOHANG\),)626 1080 A1759(and/or)S2069(that)S2273(children)S2656(of)S2793(the)S2969(current)S3308(process)S3663(that)S3868(are)S(stopped)312 4046 A4412(due)S4611(to)S4743(a)S4842(SIGTTIN,)S3672 V1080(SIGTTOU,)S1580(SIGTSTP,)S2046(or)S2172(SIGSTOP)S2624(signal)S(should)267 2906 A3215(also)S3419(have)S3650(their)S3876(status)S4146(reported)S4523(\(WUNTRACED\).)S3792 V1080(\(Job)S1278(control)S1588(is)S1680(not)S1833(implemented)S2383(for)S2526(Minix,)S2821(but)S2974(these)S3206(symbold)S3576(and)S3746(signals)S4050(are.\))S3960 V1080(When)S1353(the)S(WNOHANG)533 1509 A2075(option)S2364(is)S2464(speci\256ed)S2855(and)S3033(no)S3166(processes)S3585(wish)S3808(to)S3919(report)S4193(status,)S10 B4481(waitpid)S10 R4840(returns)S10 R-15154(-)S10 R5211(1)S4080 V1080(with)S10 B(errno)241 1304 A10 R1590(set)S1747(to)S10 B1870(EAGAIN)S10 R2273(.)S2368(The)S(WNOHANG)533 2570 A3148(and)S3337(WUNTRACED)S4026(options)S4365(may)S4582(be)S4721(combined)S5161(by)S4200 V10 I1080(or)S10 R1177('ing)S1364(the)S1512(two)S1688(values.)S4368 V9 R720(N)S722(NO)S790(OT)S858(TE)S916(ES)S974(S)S4488 V10 R1080(The)S1262(call)S10 B1433(wait\(&)S10 I1736(status)S10 B1978(\))S10 R2037(is)S2129(equivalent)S2573(to)S10 B2676(waitpid\()S10 B-13035(-)S10 B3092(1,)S3192(&)S10 I3276(status)S10 B3518(,)S3568(0\))S10 R3652(.)S4656 V1080(See)S10 B1262(sigaction)S10 R1642(\(2\))S1796(for)S1950(a)S2031(list)S2190(of)S2310(termination)S2810(statuses)S3159(\(signals\);)S3570(0)S3656(status)S3921(indicates)S4315(normal)S4637(termination.)S5188(A)S4776 V1080(special)S1390(status)S(\(0177\))268 1649 A1946(is)S2042(returned)S2407(for)S2554(a)S(stopped)312 2628 A2969(process)S3300(that)S3480(has)S3643(not)S3800(terminated)S4260(and)S4434(can)S4603(be)S4727(restarted;)S5132(see)S4896 V10 B1080(ptrace)S10 R1355(\(2\).)S1551(If)S1647(the)S(0200)200 1798 A2026(bit)S2160(of)S2272(the)S2423(termination)S2915(status)S3172(is)S3267(set,)S3432(a)S3505(core)S3707(image)S3981(of)S4093(the)S4244(process)S4574(was)S(produced)374 4759 A5161(by)S5016 V1080(the)S1228(system.)S5184 V1080(If)S1176(the)S1327(parent)S1607(process)S1937(terminates)S(without)307 2385 A(waiting)302 2720 A3050(on)S3178(its)S3301(children,)S3684(the)S(initialization)509 3835 A4372(process)S4703(\(process)S5068(ID)S5204(=)S5304 V1080(1\))S1189(inherits)S1516(the)S1664(children.)S5472 V10 I1080(<sys/wait.h>)S10 R1640(de\256nes)S1950(a)S2020(number)S2352(of)S2461(macros)S2777(that)S2953(operate)S3275(on)S3400(a)S3470(status)S3724(word:)S5640 V10 B1080(WIFEXITED\()S10 I1701(status)S10 B1943(\))S5760 V10 R1330(True)S1546(if)S1633(normal)S1943(exit.)S5928 V10 B1080(WEXITSTATUS\()S10 I1852(status)S10 B2094(\))S6048 V10 R1330(Exit)S1523(status)S1777(if)S1864(the)S2012(process)S2339(returned)S2700(by)S2825(a)S2895(normal)S3205(exit,)S3406(zero)S3605(otherwise.)S6216 V10 B1080(WTERMSIG\()S10 I1689(status)S10 B1931(\))S6336 V10 R1330(Signal)S1612(number)S1944(if)S2031(the)S2179(process)S2506(died)S2704(by)S2829(a)S2899(signal,)S3189(zero)S3388(otherwise.)S6504 V10 B1080(WIFSIGNALED\()S10 I1841(status)S10 B2083(\))S6624 V10 R1330(True)S1546(if)S1633(the)S1781(process)S2108(died)S2306(by)S2431(a)S2501(signal.)S6792 V10 B1080(WIFSTOPPED\()S10 I1780(status)S10 B2022(\))S6912 V10 R1330(True)S1546(if)S1633(the)S1781(process)S2108(is)S(stopped.)337 2200 A2587(\(Never)S2893(true)S(under)229 3075 A3329(Minix.\))S7080 V10 B1080(WSTOPSIG\()S10 I1650(status)S10 B1892(\))S7200 V10 R1330(Signal)S1612(number)S1944(of)S2053(the)S2201(signal)S2466(that)S(stopped)312 2642 A2979(the)S3127(process.)S7368 V9 R720(R)S722(RE)S784(ET)S842(TU)S900(UR)S968(RN)S1030(N)S1121(V)S1123(VA)S1191(AL)S1259(LU)S1317(UE)S1385(E)S7488 V10 R1080(If)S10 B1179(wait)S10 R1395(returns)S1706(due)S1882(to)S1992(a)S(stopped)312 2069 A2413(or)S2529(terminated)S2992(child)S3225(process,)S3584(the)S3739(process)S4073(ID)S4212(of)S4328(the)S4483(child)S4716(is)S4815(returned)S5183(to)S7903 V720(Page)S941(1)S2669(\()S2711(June)S2920(30,)S(1985)200 3070 A3278(\))S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Page: 2 2BP/slant 0 def/height 0 def480 V10 R720(WAIT)S992(\()S1034(2)S1092(\))S2696(Eighth)S(Edition)296 2989 A4855(WAIT)S5127(\()S5169(2)S5227(\))S960 V1080(the)S(calling)274 1228 A1527(process.)S1904(Otherwise,)S2369(a)S2439(value)S2682(of)S10 R-12791(-)S10 R2848(1)S2923(is)S3015(returned)S3376(and)S10 B(errno)241 3546 A10 R3812(is)S3904(set)S4041(to)S4144(indicate)S4488(the)S4636(error.)S1128 V10 B1080(Waitpid)S10 R1457(returns)S10 R-11762(-)S10 R1819(1)S1894(if)S1981(there)S2208(are)S2357(no)S2482(children)S2837(not)S2990(previously)S3439(waited)S3733(for,)S3901(if)S3988(the)S4136(process)S4463(that)S4640(it)S4722(wants)S4983(to)S5087(wait)S1248 V1080(for)S1223(doesn't)S1544(exist,)S1784(or)S1893(if)S(WNOHANG)533 1980 A2538(is)S2630(speci\256ed)S3013(and)S3183(there)S3410(are)S3559(no)S(stopped)312 3684 A4021(or)S4130(exited)S4401(children.)S1416 V9 R720(E)S722(ER)S780(RR)S842(RO)S904(OR)S972(RS)S1034(S)S1536 V10 B1080(Wait)S10 R(will)157 1317 A1499(fail)S1659(and)S1829(return)S2095(immediately)S2623(if)S2710(one)S2880(or)S2989(more)S3221(of)S3330(the)S3478(following)S3894(are)S4043(true:)S1704 V1080([ECHILD])S1830(The)S(calling)274 2012 A2311(process)S2638(has)S2797(no)S2922(existing)S3265(unwaited-for)S3811(child)S4037(processes.)S1872 V1080([EFAULT])S1830(The)S10 I2012(status)S10 R2271(argument)S2676(points)S2946(to)S3049(an)S(illegal)252 3169 A3446(address.)S2040 V([EAGAIN])456 1080 A10 B1830(Waitpid)S10 R2207(is)S2299(called)S2565(with)S2769(the)S(WNOHANG)533 2917 A3475(option)S3756(and)S3926(no)S4051(child)S4277(has)S4436(exited)S4707(yet.)S2208 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S2328 V10 B1080(execve)S10 R1360(\(2\),)S10 B1528(exit)S10 R1685(\(2\),)S10 B1853(sigaction)S10 R2233(\(2\).)S7903 V720(September)S1176(13,)S(1996)200 1326 A2669(\()S2711(June)S2920(30,)S(1985)200 3070 A3278(\))S4990(Page)S5211(2)S8143 VEP%%Trailer%%DocumentFonts: Times-Roman Times-Bold Times-Italic%%Pages: 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -