[libc-commits] [libc] [libc] Add missing errno_macros.h include to pthread schedparam (PR #191235)

via libc-commits libc-commits at lists.llvm.org
Thu Apr 9 09:47:42 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Jeff Bailey (kaladron)

<details>
<summary>Changes</summary>

Both pthread_attr_getschedparam and pthread_attr_setschedparam use ENOTSUP but relied on getting it transitively through <pthread.h>. Added the explicit include so these files compile in standalone builds with -nostdinc.

---
Full diff: https://github.com/llvm/llvm-project/pull/191235.diff


2 Files Affected:

- (modified) libc/src/pthread/pthread_attr_getschedparam.cpp (+1) 
- (modified) libc/src/pthread/pthread_attr_setschedparam.cpp (+1) 


``````````diff
diff --git a/libc/src/pthread/pthread_attr_getschedparam.cpp b/libc/src/pthread/pthread_attr_getschedparam.cpp
index 5219c4a75c862..51fddea672af0 100644
--- a/libc/src/pthread/pthread_attr_getschedparam.cpp
+++ b/libc/src/pthread/pthread_attr_getschedparam.cpp
@@ -11,6 +11,7 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
+#include "hdr/errno_macros.h"
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/pthread/pthread_attr_setschedparam.cpp b/libc/src/pthread/pthread_attr_setschedparam.cpp
index 1a80f0bd48d24..76b2e5177676c 100644
--- a/libc/src/pthread/pthread_attr_setschedparam.cpp
+++ b/libc/src/pthread/pthread_attr_setschedparam.cpp
@@ -11,6 +11,7 @@
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 
+#include "hdr/errno_macros.h"
 #include <pthread.h>
 
 namespace LIBC_NAMESPACE_DECL {

``````````

</details>


https://github.com/llvm/llvm-project/pull/191235


More information about the libc-commits mailing list