Module Name:    src
Committed By:   christos
Date:           Sun Mar 28 17:30:01 UTC 2021

Modified Files:
        src/tests/lib/libc/sys: t_sendrecv.c

Log Message:
yield so we can lose packets


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_sendrecv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_sendrecv.c
diff -u src/tests/lib/libc/sys/t_sendrecv.c:1.7 src/tests/lib/libc/sys/t_sendrecv.c:1.8
--- src/tests/lib/libc/sys/t_sendrecv.c:1.7	Sun Mar 21 12:58:07 2021
+++ src/tests/lib/libc/sys/t_sendrecv.c	Sun Mar 28 13:30:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_sendrecv.c,v 1.7 2021/03/21 16:58:07 christos Exp $	*/
+/*	$NetBSD: t_sendrecv.c,v 1.8 2021/03/28 17:30:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sendrecv.c,v 1.7 2021/03/21 16:58:07 christos Exp $");
+__RCSID("$NetBSD: t_sendrecv.c,v 1.8 2021/03/28 17:30:01 christos Exp $");
 
 #include <atf-c.h>
 #include <sys/types.h>
@@ -40,6 +40,7 @@ __RCSID("$NetBSD: t_sendrecv.c,v 1.7 202
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sched.h>
 #include <unistd.h>
 #include <signal.h>
 
@@ -94,6 +95,8 @@ receiver(int sd)
 				return;
 			if (p.seq != seq)
 				printf("%ju != %ju\n", p.seq, seq);
+			if (seq % 10 == 0)
+				sched_yield();
 			seq = p.seq + 1;
 		}
 //		printf("<<%zd %d %ju\n", n, errno, seq);

Reply via email to