简体   繁体   English

execvp() 函数在 clion 中工作正常,但在终端中不能正常工作

[英]execvp() function working fine in clion but not in terminal

I tried to run an program, which use container and execvp() function.我试图运行一个程序,它使用容器和 execvp() 函数。

When I'm trying to run in the CLion, the program works fine, but when I'm running in my shell, it doesn't work, even when I use CLION's compile file.当我尝试在 CLion 中运行时,程序运行良好,但是当我在我的 shell 中运行时,它不起作用,即使我使用 CLION 的编译文件也是如此。 it says: "no such file or directory".它说:“没有这样的文件或目录”。

Any idea?任何想法? the arguments that I use looks OK in the two options.我使用的参数在两个选项中看起来都不错。

After a long time, I understand what was the problem.很久之后,我明白了问题所在。 I used clone() function to create child to the main process, and I used not right flags.我使用 clone() 函数为主进程创建子进程,并且我使用了不正确的标志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM