Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys yield so we can lose packets



details:   https://anonhg.NetBSD.org/src/rev/2f639a245d18
branches:  trunk
changeset: 960773:2f639a245d18
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Mar 28 17:30:01 2021 +0000

description:
yield so we can lose packets

diffstat:

 tests/lib/libc/sys/t_sendrecv.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r cd2d1f64a446 -r 2f639a245d18 tests/lib/libc/sys/t_sendrecv.c
--- a/tests/lib/libc/sys/t_sendrecv.c   Sun Mar 28 16:35:37 2021 +0000
+++ b/tests/lib/libc/sys/t_sendrecv.c   Sun Mar 28 17:30:01 2021 +0000
@@ -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 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sched.h>
 #include <unistd.h>
 #include <signal.h>
 
@@ -94,6 +95,8 @@
                                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);



Home | Main Index | Thread Index | Old Index