You don't error check waitpid() — you should. Note that if fork() fails, the recorded 'pid' is -1 , and when you do waitpid(-1, 0 ...
確定! 回上一頁