util: Drop *BSD headers in `batchpriority.cpp`
What changed, and why it matters
This is a straightforward portability fix for how Bitcoin Core sets thread scheduling priority on non-Windows systems. It rearranges and trims header files so the code compiles correctly on Linux and various BSD variants. There is no security vulnerability here.
No security action needed. Treat as a normal build-system/portability patch.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors includes in src/util/batchpriority.cpp. It removes BSD-specific pthread_np.h and the conditional pthread.h inclusion, instead unconditionally including pthread.h and sched.h under !WIN32. It also adds the missing local header util/batchpriority.h and the standard
Changed components
src/util/batchpriority.cppInspect captured patch +4 / −4
diff --git a/src/util/batchpriority.cpp b/src/util/batchpriority.cpp
index 15442346..86abc011 100644
--- a/src/util/batchpriority.cpp
+++ b/src/util/batchpriority.cpp
@@ -2,15 +2,15 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include <util/batchpriority.h>
+
#include <logging.h>
#include <util/syserror.h>
-#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
-#include <pthread.h>
-#include <pthread_np.h>
-#endif
+#include <string>
#ifndef WIN32
+#include <pthread.h>
#include <sched.h>
#endif
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.