From dab55ef6e222d0a44ffe019c684c87a4b161e8fb Mon Sep 17 00:00:00 2001 From: zhanghongyu Date: Mon, 17 Jun 2024 21:08:56 +0800 Subject: [PATCH] unistd.h: Adds some posix supported definitions. resolve compilation and functional errors caused by posix definitions check of third-party libraries. Signed-off-by: zhanghongyu --- include/unistd.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/unistd.h b/include/unistd.h index 2e2f52419a..10463f28b5 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -46,8 +46,6 @@ #undef _POSIX_SAVED_IDS #undef _POSIX_JOB_CONTROL #define _POSIX_MESSAGE_PASSING 1 -#undef _POSIX_MAPPED_FILES -#undef _POSIX_SHARED_MEMORY_OBJECTS #define _POSIX_PRIORITY_SCHEDULING 1 #ifndef CONFIG_DISABLE_POSIX_TIMERS # define _POSIX_TIMERS 1 @@ -67,6 +65,10 @@ #define _POSIX_REALTIME_SIGNALS _POSIX_VERSION #define _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_VERSION #define _POSIX_SEMAPHORES _POSIX_VERSION +#define _POSIX_SHARED_MEMORY_OBJECTS _POSIX_VERSION +#define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION +#define _POSIX_MAPPED_FILES _POSIX_VERSION +#define _POSIX_THREADS _POSIX_VERSION #ifdef CONFIG_FS_AIO # define _POSIX_ASYNCHRONOUS_IO _POSIX_VERSION @@ -92,6 +94,9 @@ #undef _POSIX_ASYNC_IO #undef _POSIX_PRIO_IO +#define _XOPEN_UNIX 1 +#define _XOPEN_VERSION 700L + /* Constants used with POSIX pathconf(). pathconf() will return -1 and set * errno to ENOSYS for most of these. */