我想的execve調用在C程序一個shell:的execve調用
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
main()
{
char* path = "/bin/sh";
int err = execve(path, &path, NULL);
printf("%d\n", err);
printf("%s\n", strerror(errno));
printf("%x, %x\n", path, &path);
}
但是輸出是:
-1
Bad address
80485c0, bf816f4c