Module Name:    src
Committed By:   jdolecek
Date:           Sat Feb  6 00:08:58 UTC 2021

Modified Files:
        src/lib/libc/thread-stub: thread-stub.c

Log Message:
change libc sched_yield() stub to actually still call the syscall
instead of doing nothing when app is not linked with pthread; this matches
other systems

suggested by Mateusz Guzik in:
http://mail-index.netbsd.org/tech-kern/2020/07/19/msg026620.html


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/thread-stub/thread-stub.c

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

Modified files:

Index: src/lib/libc/thread-stub/thread-stub.c
diff -u src/lib/libc/thread-stub/thread-stub.c:1.30 src/lib/libc/thread-stub/thread-stub.c:1.31
--- src/lib/libc/thread-stub/thread-stub.c:1.30	Tue Jan 14 18:18:59 2020
+++ src/lib/libc/thread-stub/thread-stub.c	Sat Feb  6 00:08:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: thread-stub.c,v 1.30 2020/01/14 18:18:59 kamil Exp $	*/
+/*	$NetBSD: thread-stub.c,v 1.31 2021/02/06 00:08:58 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: thread-stub.c,v 1.30 2020/01/14 18:18:59 kamil Exp $");
+__RCSID("$NetBSD: thread-stub.c,v 1.31 2021/02/06 00:08:58 jdolecek Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -394,12 +394,13 @@ __libc_thr_self_stub(void)
 	return ((thr_t) -1);
 }
 
+/* This is the strong symbol generated for sched_yield(2) via WSYSCALL() */
+int _sys_sched_yield(void);
+
 int
 __libc_thr_yield_stub(void)
 {
-
-	/* Nothing to do. */
-	return (0);
+	return _sys_sched_yield();
 }
 
 int

Reply via email to