Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/sys/kern Add a ucontext test from Nathan's testsuite.
details: https://anonhg.NetBSD.org/src/rev/56738970590c
branches: trunk
changeset: 542489:56738970590c
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Jan 30 19:47:00 2003 +0000
description:
Add a ucontext test from Nathan's testsuite.
diffstat:
regress/sys/kern/Makefile | 4 ++--
regress/sys/kern/ucontext/Makefile | 13 +++++++++++++
regress/sys/kern/ucontext/context.c | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 2 deletions(-)
diffs (69 lines):
diff -r 57b7fc33700f -r 56738970590c regress/sys/kern/Makefile
--- a/regress/sys/kern/Makefile Thu Jan 30 19:31:59 2003 +0000
+++ b/regress/sys/kern/Makefile Thu Jan 30 19:47:00 2003 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.20 2002/11/30 09:31:31 jdolecek Exp $
+# $NetBSD: Makefile,v 1.21 2003/01/30 19:47:00 thorpej Exp $
SUBDIR+= execve extent getcwd ipf kqueue lock lockf pipe poll ras \
- sigtramp sysvmsg sysvsem sysvshm unfdpass writev
+ sigtramp sysvmsg sysvsem sysvshm ucontext unfdpass writev
.include <bsd.subdir.mk>
diff -r 57b7fc33700f -r 56738970590c regress/sys/kern/ucontext/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/sys/kern/ucontext/Makefile Thu Jan 30 19:47:00 2003 +0000
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2003/01/30 19:47:00 thorpej Exp $
+
+WARNS=1
+
+PROG= context
+SRCS= context.c
+
+NOMAN=
+
+regress:
+ ./context
+
+.include <bsd.prog.mk>
diff -r 57b7fc33700f -r 56738970590c regress/sys/kern/ucontext/context.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/sys/kern/ucontext/context.c Thu Jan 30 19:47:00 2003 +0000
@@ -0,0 +1,36 @@
+/* $NetBSD: context.c,v 1.1 2003/01/30 19:47:00 thorpej Exp $ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <ucontext.h>
+
+int
+main(int argc, char *argv[])
+{
+ ucontext_t u, v, w;
+ volatile int x, y;
+
+ x = 0;
+ y = 0;
+
+ printf("Start\n");
+
+ getcontext(&u);
+ y++;
+
+ printf(" X is %d\n", x);
+
+ getcontext(&v);
+
+ if ( x < 20 ) {
+ x++;
+ getcontext(&w);
+ printf("Adding one and going around.\n");
+ setcontext(&u);
+ }
+
+ printf("End, y = %d\n", y);
+ assert(y == 21);
+
+ return 0;
+}
Home |
Main Index |
Thread Index |
Old Index