summaryrefslogtreecommitdiff
path: root/src/user/app/testelf
diff options
context:
space:
mode:
authordzwdz2022-07-27 13:59:52 +0200
committerdzwdz2022-07-27 13:59:52 +0200
commitc77b0fa7916f79c099ee4a6a80a093334e9090ac (patch)
tree19eaedcecaa1584b83342853f1616975b50cad97 /src/user/app/testelf
parent55b3a04e97b7ddd0db17a4fc3ba35461b106b92f (diff)
user/libc: execve() supports passing argv now
Diffstat (limited to 'src/user/app/testelf')
-rw-r--r--src/user/app/testelf/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/user/app/testelf/main.c b/src/user/app/testelf/main.c
index a3e54b8..5111791 100644
--- a/src/user/app/testelf/main.c
+++ b/src/user/app/testelf/main.c
@@ -1,9 +1,12 @@
#include <stdio.h>
-const char *str = "Hello!\n", *str2 = "World.\n";
+const char *str = "Hello!", *str2 = "World.";
-int main(void) {
+int main(int argc, char **argv, char **envp) {
printf("elftest's &main == 0x%x\n", &main);
- printf("%s%s", str, str2);
+ printf("%s %s\n", str, str2);
+ printf("argc == 0x%x\n", argc);
+ for (int i = 0; i < argc; i++)
+ printf("argv[0x%x] == 0x%x == \"%s\"\n", i, argv[i], argv[i]);
return 0;
}