+ -
当前位置:首页 → 问答吧 → linux system函数调用问题

linux system函数调用问题

时间:2011-09-02

来源:互联网

linux下system函数调用shell命令后,怎样让主进程等子进程返回,然后再接着执行主线程?最好举个列子,本人刚学,谢谢

作者: yy_112233   发布时间: 2011-09-02

system本身就是同步的,子进程不执行完不会往下走

作者: jackyjkchen   发布时间: 2011-09-02

pid_t wait(int *status);
pid_t waitpid(pid_t pid, int *status, int options);

作者: zmlovelx   发布时间: 2011-09-02