diff --git a/build.sh b/build.sh index 65ef6a2..80c0d85 100755 --- a/build.sh +++ b/build.sh @@ -3,4 +3,4 @@ set -e mkdir -p build/ -gcc -std=gnu23 -I include/ src/*.c -o build/main \ No newline at end of file +gcc -std=gnu23 -I include/ src/*.c -o build/gandalf \ No newline at end of file diff --git a/src/main.c b/src/main.c index cc98203..a2b7b85 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,33 @@ -int main() { +#include +#include +#include +// #include \n"); + return 1; + } + pid_t child = fork(); + + if (child == -1) { + printf("Failed to fork\n"); + return 1; + } else if (child == 0) { + printf("Child process\n"); + run_child(argv[1]); + } else { + printf("Parent process\n"); + + } } \ No newline at end of file diff --git a/tests/main.c b/tests/main.c new file mode 100644 index 0000000..6380ac8 --- /dev/null +++ b/tests/main.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello, world\n"); + return 0; +} \ No newline at end of file