diff --git a/usr/hello/hello.c b/usr/hello/hello.c index 7da2450..34d9357 100644 --- a/usr/hello/hello.c +++ b/usr/hello/hello.c @@ -15,17 +15,30 @@ #include +#include +#include #include +#define HELLO_CATCH_COMMAND "catch" + int main(int argc, char *argv[]) { - printf("Hello, world! from userspace\n"); + printf("Hello, world!\n"); printf("argv:\n"); for(int i = 0; i < argc; ++i) { printf(" %d -> %s\n", i, argv[i]); } + // if we receive the catch command, RUN! + if (argc > 1 && !strncmp(argv[1], HELLO_CATCH_COMMAND, sizeof(HELLO_CATCH_COMMAND))) { + while(1) { + printf("Catch me if you can!\n"); + // wait for 1 second + sleep(1); + } + } + return EXIT_SUCCESS; }