2024-01-03 03:22:36 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
2022-10-26 09:47:38 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
2024-03-15 16:15:19 +00:00
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
char *argv[] = { "argv1", "argv2", NULL };
|
|
|
|
|
char *envp[] = { "home=/", "version=1.1", NULL };
|
|
|
|
|
// The hello will be put at /execve/hello in InitRamfs
|
|
|
|
|
printf("Execve a new file /execve/hello:\n");
|
|
|
|
|
// flush the stdout content to ensure the content print to console
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
execve("/regression/execve/hello", argv, envp);
|
|
|
|
|
printf("Should not print\n");
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
return 0;
|
2024-03-15 16:28:37 +00:00
|
|
|
}
|