From f84d89b0ca9c8982d436aa12be75554722462090 Mon Sep 17 00:00:00 2001 From: wangxiaoyao Date: Mon, 20 Feb 2023 13:45:07 +0800 Subject: [PATCH] [libc] including musl signal.h with _POSIX_SOURCE --- components/libc/compilers/common/include/sys/signal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/libc/compilers/common/include/sys/signal.h b/components/libc/compilers/common/include/sys/signal.h index 6e06c8ba14..8e67ae9ae1 100644 --- a/components/libc/compilers/common/include/sys/signal.h +++ b/components/libc/compilers/common/include/sys/signal.h @@ -17,7 +17,17 @@ extern "C" { #endif /* __cplusplus */ #ifdef RT_USING_MUSLLIBC +/* this is require for musl */ +#ifndef _POSIX_SOURCE +#define _POSIX_SOURCE #include +/* limit influenced of _POSIX_SOURCE */ +#undef _POSIX_SOURCE + +#else /* ndef _POSIX_SOURCE */ +#include +#endif + #else #include