您的位置:首页 > 运维架构 > Linux

C/C++: linux下打开新进程

2014-06-26 15:57 120 查看
#include <iostream>
#include <unistd.h>

using namespace std;

int main()
{
cout << "curr pid " << getpid() << endl;
char *args[] = {"/bin/ls", NULL};
if(execve("/bin/ls", args, NULL)<0)
cout<<"open new id error"<<endl;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: