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 d0a450ef0d4c2de5e27da1e64e2c1b1e72cef7c1
Author: buxiasen <[email protected]>
AuthorDate: Wed Apr 1 17:24:25 2026 +0800

    libc/sched: Include unistd.h in clock_getcpuclockid().
    
    Include unistd.h to provide the declaration of getpid(), which is
    needed when _SCHED_GETPID() expands to getpid() in protected build
    mode. Without this include, GCC 14+ treats the implicit function
    declaration as a hard error.
    
    Signed-off-by: buxiasen <[email protected]>
    Signed-off-by: ganjing <[email protected]>
---
 libs/libc/sched/clock_getcpuclockid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libs/libc/sched/clock_getcpuclockid.c 
b/libs/libc/sched/clock_getcpuclockid.c
index 6ab7f47ff50..042a9ce7b7e 100644
--- a/libs/libc/sched/clock_getcpuclockid.c
+++ b/libs/libc/sched/clock_getcpuclockid.c
@@ -27,6 +27,7 @@
 #include <nuttx/config.h>
 
 #include <time.h>
+#include <unistd.h>
 
 #include <nuttx/clock.h>
 #include <nuttx/sched.h>

Reply via email to