xcode11 bate5 版里使用C语言的wait和waitpid函数一直返回-1,错误是wait: Interrupted system call
爱你才怪 2019-08-20 10:40:44 测试代码:
pid_t pid = fork ();
if (pid == 0)
{
int i = 1;
while (i < 5)
{
printf ("i = %d\n",i);
i++;
sleep (1);
}
exit (100);
}
else
{
int res = wait (NULL);
if ( -1 == res)
{
perror ("wait");
}
}