summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-11-04 07:38:09 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-11-04 07:38:09 +0000
commit504f47951d34b0d731259bc032ba27f595c14046 (patch)
tree44092063a75d1e5a23cb234a29d98fde3efc2d61 /regress
parentfdd40f245000a3b5bebc83e24e137190baf44e06 (diff)
old __syscall test is really a wait() test
Diffstat (limited to 'regress')
-rw-r--r--regress/sys/kern/Makefile4
-rw-r--r--regress/sys/kern/wait/Makefile5
-rw-r--r--regress/sys/kern/wait/wait.c35
3 files changed, 42 insertions, 2 deletions
diff --git a/regress/sys/kern/Makefile b/regress/sys/kern/Makefile
index 7d789905f0e..65a8c692ad1 100644
--- a/regress/sys/kern/Makefile
+++ b/regress/sys/kern/Makefile
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile,v 1.41 2003/04/23 21:45:57 jason Exp $
+# $OpenBSD: Makefile,v 1.42 2003/11/04 07:38:08 mickey Exp $
SUBDIR+= execve getrusage kqueue mmap mmap2 mmap3 dup2 minherit rlimit-file
-SUBDIR+= fcntl_dup dup2_self pread preadv exit mbuf pwrite pwritev
+SUBDIR+= fcntl_dup dup2_self pread preadv exit wait mbuf pwrite pwritev
SUBDIR+= syscall __syscall unfdpass accept nanosleep sysvmsg sysvsem
SUBDIR+= sysvshm rfork gettimeofday signal exec_self noexec
SUBDIR+= rcvtimeo
diff --git a/regress/sys/kern/wait/Makefile b/regress/sys/kern/wait/Makefile
new file mode 100644
index 00000000000..2dd0918f03f
--- /dev/null
+++ b/regress/sys/kern/wait/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2003/11/04 07:38:08 mickey Exp $
+
+PROG= wait
+
+.include <bsd.regress.mk>
diff --git a/regress/sys/kern/wait/wait.c b/regress/sys/kern/wait/wait.c
new file mode 100644
index 00000000000..1b93de0ac20
--- /dev/null
+++ b/regress/sys/kern/wait/wait.c
@@ -0,0 +1,35 @@
+/* $OpenBSD: wait.c,v 1.1 2003/11/04 07:38:08 mickey Exp $ */
+/*
+ * Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
+ */
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <err.h>
+
+int
+main()
+{
+ int status;
+
+ switch(fork()) {
+ case -1:
+ err(1, "fork");
+ case 0:
+ __syscall((u_int64_t)SYS_exit, 17, 0);
+ abort();
+ }
+
+ if (wait(&status) < 0)
+ err(1, "wait");
+
+ if (!WIFEXITED(status))
+ errx(1, "child didn't exit gracefully");
+
+ if (WEXITSTATUS(status) != 17)
+ errx(1, "wrong exit status");
+
+ return 0;
+}