在多线程环境中使用Linux中的系统(命令“命令”)不起作用?
我正在C程序中的多线程环境中使用System CMD,但是它总是返回-1给出错误“ no child crocess” 和Errorno 10
void test()
{
int ret;
system("df -h");
printf("%s %d",strerror(errno), errorno);
}
void* foo(void* p){
test();
}
注意:此代码在多线程环境中,并且使用SIGQUIT,也使用了sigquit 。
I am using system cmd in multithreaded environment in c program but it is always returning -1 giving error "No Child process" and errorno 10
void test()
{
int ret;
system("df -h");
printf("%s %d",strerror(errno), errorno);
}
void* foo(void* p){
test();
}
NOTE: This code is in multithreaded environmet and also SIGACTION, SIGQUIT are used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论