diff --git a/src/kernel/apps/Jamfile b/src/kernel/apps/Jamfile index 50dd7b341a..fa1f54152b 100644 --- a/src/kernel/apps/Jamfile +++ b/src/kernel/apps/Jamfile @@ -1,6 +1,7 @@ SubDir OBOS_TOP src kernel apps ; KernelObjects + exec_test.c false_main.c fibo_main.c init.c diff --git a/src/kernel/apps/exec_test.c b/src/kernel/apps/exec_test.c new file mode 100644 index 0000000000..4f6c9bae17 --- /dev/null +++ b/src/kernel/apps/exec_test.c @@ -0,0 +1,33 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ + + +#include + +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + printf("exec_test: this is thread %ld\n", find_thread(NULL)); + + if (argc < 2) { + puts("going to execl()..."); + execl("/bin/exec_test", "/bin/exec_test", "argument 1", NULL); + printf("execl() returned: %s\n", strerror(errno)); + } else { + int i; + puts("got arguments:"); + for (i = 0; i < argc; i++) + printf("%d: \"%s\"\n", i, argv[i]); + } + + return 0; +} +