man了一下,写得清清楚楚是返回pid的。。。
waitpid(): on success, returns the process ID of the child whose state has changed; if WNOHANG was specified and one or more child(ren) specified by pid exist, but have not yet changed state, then 0 is returned. On error, -1 is returned.
但是我写了个程序,那里面waitpid()总是返回1,而且把waitpid()改成wait()却能正确返回pid。有了解这种情况的么?
waitpid(): on success, returns the process ID of the child whose state has changed; if WNOHANG was specified and one or more child(ren) specified by pid exist, but have not yet changed state, then 0 is returned. On error, -1 is returned.
但是我写了个程序,那里面waitpid()总是返回1,而且把waitpid()改成wait()却能正确返回pid。有了解这种情况的么?