From: claudio Date: Tue, 30 Jul 2024 13:28:27 +0000 (+0000) Subject: sched_yield() is not strong enough to overflow the recv buffer on some X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=539ef4cc2e5896c1d20e3e179c9c039a0d237c0f;p=openbsd sched_yield() is not strong enough to overflow the recv buffer on some systems. Use a proper sleep using usleep(100) instead. --- diff --git a/regress/lib/libc/sys/t_sendrecv.c b/regress/lib/libc/sys/t_sendrecv.c index ae6425f40dd..178d9338b81 100644 --- a/regress/lib/libc/sys/t_sendrecv.c +++ b/regress/lib/libc/sys/t_sendrecv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_sendrecv.c,v 1.3 2021/12/13 16:56:48 deraadt Exp $ */ +/* $OpenBSD: t_sendrecv.c,v 1.4 2024/07/30 13:28:27 claudio Exp $ */ /* $NetBSD: t_sendrecv.c,v 1.8 2021/03/28 17:30:01 christos Exp $ */ /*- @@ -97,7 +97,7 @@ receiver(int sd) if (p.seq != seq) printf("%ju != %ju\n", p.seq, seq); if (seq % 10 == 0) - sched_yield(); + usleep(100); seq = p.seq + 1; } // printf("<<%zd %d %ju\n", n, errno, seq);