diff --git a/include/posix/dirent.h b/include/posix/dirent.h index 8242b990a1e..e2f4133b9b6 100644 --- a/include/posix/dirent.h +++ b/include/posix/dirent.h @@ -11,7 +11,7 @@ extern "C" { #endif #include -#include "sys/types.h" +#include "posix_types.h" #ifdef CONFIG_POSIX_FS #include diff --git a/include/posix/mqueue.h b/include/posix/mqueue.h index ab498f680ce..53210b5f95d 100644 --- a/include/posix/mqueue.h +++ b/include/posix/mqueue.h @@ -9,7 +9,7 @@ #include #include -#include "sys/types.h" +#include "posix_types.h" #include "sys/stat.h" #ifdef __cplusplus diff --git a/include/posix/sys/types.h b/include/posix/posix_types.h similarity index 98% rename from include/posix/sys/types.h rename to include/posix/posix_types.h index 5e657e505ff..86b3f04067c 100644 --- a/include/posix/sys/types.h +++ b/include/posix/posix_types.h @@ -12,7 +12,7 @@ extern "C" { #endif #ifndef CONFIG_ARCH_POSIX -#include_next +#include #endif #include diff --git a/include/posix/pthread.h b/include/posix/pthread.h index 4f187576e67..ce49e565f6c 100644 --- a/include/posix/pthread.h +++ b/include/posix/pthread.h @@ -11,7 +11,7 @@ #include #include #include -#include "sys/types.h" +#include "posix_types.h" #include "posix_sched.h" #include #include diff --git a/include/posix/semaphore.h b/include/posix/semaphore.h index 283e295e923..bea48ffb327 100644 --- a/include/posix/semaphore.h +++ b/include/posix/semaphore.h @@ -11,7 +11,7 @@ extern "C" { #endif #include -#include "sys/types.h" +#include "posix_types.h" int sem_destroy(sem_t *semaphore); int sem_getvalue(sem_t *restrict semaphore, int *restrict value); diff --git a/include/posix/signal.h b/include/posix/signal.h index 830b830813f..d4faff19d31 100644 --- a/include/posix/signal.h +++ b/include/posix/signal.h @@ -10,7 +10,7 @@ extern "C" { #endif -#include "sys/types.h" +#include "posix_types.h" #ifndef SIGEV_NONE #define SIGEV_NONE 1 diff --git a/include/posix/time.h b/include/posix/time.h index 33df6b3eb9b..78b9ea29f6a 100644 --- a/include/posix/time.h +++ b/include/posix/time.h @@ -27,7 +27,7 @@ struct timeval { #include #include -#include +#include "posix_types.h" #include #ifndef CLOCK_REALTIME diff --git a/include/posix/unistd.h b/include/posix/unistd.h index 3195de3048e..e68b46c212c 100644 --- a/include/posix/unistd.h +++ b/include/posix/unistd.h @@ -10,13 +10,16 @@ extern "C" { #endif -#include "sys/types.h" +#include "posix_types.h" #include "sys/stat.h" #ifdef CONFIG_POSIX_API #include +#ifndef _MODE_T_DECLARED typedef unsigned int mode_t; +#define _MODE_T_DECLARED +#endif /* File related operations */ extern int open(const char *name, int flags); diff --git a/lib/posix/clock.c b/lib/posix/clock.c index d179243c573..0805ddda801 100644 --- a/lib/posix/clock.c +++ b/lib/posix/clock.c @@ -6,7 +6,6 @@ #include #include #include -#include /* * `k_uptime_get` returns a timestamp based on an always increasing diff --git a/lib/posix/pthread_rwlock.c b/lib/posix/pthread_rwlock.c index f2c0521df39..fcf5b982d9e 100644 --- a/lib/posix/pthread_rwlock.c +++ b/lib/posix/pthread_rwlock.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #define INITIALIZED 1 #define NOT_INITIALIZED 0