能力值:
( LV2,RANK:10 )
|
-
-
[求助]fork之后执行printf和execl,printf执行成功但是没有输出
TopGreen
wait函数的问题,你fork过后没有wait
wait通常与fork同时出现,这里查阅资料得知
在fork函数执行前,只有一个进程在执行这段代码,在这fork过后,就变成两个进程在执行了,两个进 ... 抱歉,我代码改格式之后好像漏了两行 iterate.c line 19-20(已经重新编辑)。我觉得应该不是wait的关系,就算不wait,子程序也算独立的程序会一直运行知道子程序自己退出,这里我的问题是我在GDB里面看到printf执行成功了,但是在stdout上没有任何输出。
最后于 2020-6-20 09:30
被B1GJ0hn编辑
,原因:
|