2022-10-26 09:47:38 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
int main() {
|
2022-11-09 07:14:12 +00:00
|
|
|
char* argv[] = { "argv1", "argv2", NULL };
|
|
|
|
|
char* envp[] = { "home=/", "version=1.1", NULL };
|
2023-03-07 09:13:35 +00:00
|
|
|
// The hello will be put at /execve/hello in InitRamfs
|
|
|
|
|
printf("Execve a new file /execve/hello:\n");
|
2022-11-04 06:22:28 +00:00
|
|
|
// flush the stdout content to ensure the content print to console
|
2022-10-26 09:47:38 +00:00
|
|
|
fflush(stdout);
|
2023-07-05 06:08:58 +00:00
|
|
|
execve("/regression/execve/hello", argv, envp);
|
2022-10-26 09:47:38 +00:00
|
|
|
printf("Should not print\n");
|
2022-11-04 06:22:28 +00:00
|
|
|
fflush(stdout);
|
2022-10-26 09:47:38 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|