syscalls: implement basic execve syscall, no argc, argv, envp support yet

This commit is contained in:
2025-09-14 17:17:42 +03:00
parent 4c26652ee2
commit 91e0379fc9
9 changed files with 192 additions and 38 deletions
+22
View File
@@ -0,0 +1,22 @@
// callee.c
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[], char *envp[]) {
printf("--- In callee.c ---\n");
printf("This program has taken over the process.\n");
printf("argc: %d\n", argc);
printf("\nArguments (argv):\n");
for (int i = 0; argv[i] != NULL; i++) {
printf(" argv[%d]: %s\n", i, argv[i]);
}
printf("\nEnvironment Variables (envp):\n");
for (int i = 0; envp[i] != NULL; i++) {
printf(" %s\n", envp[i]);
}
return 0;
}