execve

#include <stdio.h>
#include <unistd.h>

int main()
{
 char *args[]={"/bin/ls",NULL};
 printf("系统分配的进程号是:%d\n",getpid());
 if (execve("/bin/ls",args,NULL)<0)
 {
  printf("创建进程出错\n");
 }
 return 0;
}

原文地址:https://www.cnblogs.com/newlist/p/2252441.html