From bc4d7f5de59f26aacdddcd5d62b1ff9747105521 Mon Sep 17 00:00:00 2001 From: gdr Date: Sun, 27 Jul 1997 23:36:25 +0000 Subject: [PATCH] Added tests for wait(2) [currently failing] and getpid(2) [currently passing]. --- lib/libc/tests/sys/getpid.c | 11 +++++++++++ lib/libc/tests/sys/wait.c | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 lib/libc/tests/sys/getpid.c create mode 100644 lib/libc/tests/sys/wait.c diff --git a/lib/libc/tests/sys/getpid.c b/lib/libc/tests/sys/getpid.c new file mode 100644 index 0000000..13be098 --- /dev/null +++ b/lib/libc/tests/sys/getpid.c @@ -0,0 +1,11 @@ +#include +#include + +int +main(int argc, char **argv) { + pid_t pid; + + pid = getpid(); + printf("pid is %d\n", pid); + return 0; +} diff --git a/lib/libc/tests/sys/wait.c b/lib/libc/tests/sys/wait.c new file mode 100644 index 0000000..8ba3b59 --- /dev/null +++ b/lib/libc/tests/sys/wait.c @@ -0,0 +1,21 @@ +/* + * This program exhibits a problem with the wait(2) system call; + * If you do a wait and have no children, you will hang in the wait. + * The man page says that -1 should be returned and errno set to + * ECHILD. + * + * $Id: wait.c,v 1.1 1997/07/27 23:36:25 gdr Exp $ + */ + +#include +#include + +int main (int argc, char **argv) { + union wait wstat; + int retval; + + printf("starting wait\n"); + retval = wait(&wstat); + printf("wait returned %d\n", retval); + return 0; +}