#include "stdio.h" #include "stdlib.h" #define __LIBRARY__ #include "unistd.h" _syscall3(int,execve2,const char *,file,char **,argv,char **,envp) /* * 测试成功则输出: * " I am test_echo." * 测试失败则输出: * " execve2 error." */ void test_execve(void){ char *argv[] = {"/bin/sh", "-c", "echo \" I am test_echo.\"", NULL}; char *env[] = {NULL}; execve2("/bin/sh", argv, env); printf(" execve2 error.\n"); } int main(void){ test_execve(); return 0; }