diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-12 16:14:21 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-03-12 16:14:21 +0100 |
| commit | 10d52f4f24f80835d28d8278df84d8bd500bd347 (patch) | |
| tree | 294bcfea9d6a22cb997b2f3a90876e4f0e4d7520 /src/examples/wait.c | |
| parent | 5453c302f0133bfc90fa26ec5c9dd1877ad24c90 (diff) | |
| download | pintos-10d52f4f24f80835d28d8278df84d8bd500bd347.tar.gz | |
add simple wait test
Diffstat (limited to 'src/examples/wait.c')
| -rw-r--r-- | src/examples/wait.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/examples/wait.c b/src/examples/wait.c new file mode 100644 index 0000000..ab0ea90 --- /dev/null +++ b/src/examples/wait.c @@ -0,0 +1,13 @@ +#include <stdio.h> +#include <syscall.h> + +int +main (int argc, char **argv) +{ + printf ("hello\n"); + if (argc != 1) { + int child = exec("wait"); + printf("%d: %d\n", child, wait(child)); + } + exit(1); +} |
