From 240359bb3f8d1373570899ae5fa17edfd6b60899 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 14 Oct 2024 23:09:44 +0200 Subject: [PATCH] Mon 14 Oct 23:09:15 CEST 2024 --- user/test/forktest.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 user/test/forktest.c diff --git a/user/test/forktest.c b/user/test/forktest.c new file mode 100644 index 0000000..6e8a812 --- /dev/null +++ b/user/test/forktest.c @@ -0,0 +1,17 @@ +#include "library/syscalls.h" +#include "library/string.h" + +int main(int argc, char *argv[]) +{ + printf("hello world, I am %d.\n", syscall_process_self()); + int x = syscall_process_fork(); + printf("My fork returned %d\n", x); + + printf("Some numbers:\n"); + + int i; + for(i = 0; i < 5; ++i) { + printf("%d\n", i); + } + return 0; +}