syscalls: implement argv and envp handling in execve

This commit is contained in:
2025-09-16 22:41:32 +03:00
parent 7c2f3735bf
commit 2c8b5d4752
2 changed files with 72 additions and 5 deletions
+2 -2
View File
@@ -9,10 +9,10 @@ int main() {
// Arguments for the new program
// The first argument is conventionally the program name
char *argv[] = {NULL}; //{ "./callee", "first_arg", "second_arg", NULL };
char *argv[] = { "./callee", "first_arg", "second_arg", NULL };
// Environment variables for the new program
char *envp[] = {NULL}; //{ "CUSTOM_VAR=Hello from caller!", "ANOTHER_VAR=123", NULL };
char *envp[] = { "CUSTOM_VAR=Hello from caller!", "ANOTHER_VAR=123", NULL };
// The execve system call
// The first argument is the path to the executable