This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 53818d5a7ef1f19a553b9f9a569d7e06365b6172
Author: Marco Casaroli <[email protected]>
AuthorDate: Mon Oct 19 01:49:32 2026 +0200

    include/pthread.h: Make the <sched.h> symbols visible.
    
    POSIX says that the inclusion of <pthread.h> makes the symbols of
    <sched.h> and <time.h> visible.  NuttX included only <time.h>.  A
    program that includes only <pthread.h> and calls sched_yield() or uses
    SCHED_FIFO did not compile.
    
    Include <sched.h> in <pthread.h>.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 include/pthread.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/pthread.h b/include/pthread.h
index 211d55522ee..4d2187d8571 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -36,6 +36,7 @@
 #include <stdbool.h>         /* C99 boolean types */
 #include <unistd.h>          /* For getpid */
 #include <signal.h>          /* Needed for sigset_t, includes this file */
+#include <sched.h>           /* POSIX: pthread.h makes sched.h visible */
 #include <time.h>            /* Needed for struct timespec */
 
 #ifdef CONFIG_PTHREAD_SPINLOCKS

Reply via email to