Skip to content

Commit 5cbb2a4

Browse files
cfriedtjhedberg
authored andcommitted
posix: switch to using posix_time.h and posix_signal.h
To avoid conflicts between the C library's `time.h` and signal.h use an "override" header (when necessary) for C libraries that do not themselves provide POSIX definitions in `time.h` or `signal.h`. V2 Signed-off-by: Chris Friedt <[email protected]>
1 parent 882ee96 commit 5cbb2a4

File tree

33 files changed

+431
-401
lines changed

33 files changed

+431
-401
lines changed

include/zephyr/posix/mqueue.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
#ifndef ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_
88
#define ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_
99

10+
#include <time.h>
11+
#include <signal.h>
12+
1013
#include <zephyr/kernel.h>
11-
#include <zephyr/posix/time.h>
1214
#include <zephyr/posix/fcntl.h>
13-
#include <zephyr/posix/signal.h>
1415
#include <zephyr/posix/sys/stat.h>
1516
#include <zephyr/posix/posix_types.h>
1617

include/zephyr/posix/posix_features.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@
5252
#define _POSIX_BARRIERS _POSIX_VERSION
5353
#endif
5454

55-
#ifdef CONFIG_POSIX_CLOCK_SELECTION
56-
#define _POSIX_CLOCK_SELECTION _POSIX_VERSION
57-
#endif
58-
59-
#ifdef CONFIG_POSIX_CPUTIME
60-
#define _POSIX_CPUTIME _POSIX_VERSION
61-
#endif
62-
6355
#ifdef CONFIG_POSIX_FSYNC
6456
#define _POSIX_FSYNC _POSIX_VERSION
6557
#endif
@@ -90,10 +82,6 @@
9082
#define _POSIX_MESSAGE_PASSING _POSIX_VERSION
9183
#endif
9284

93-
#ifdef CONFIG_POSIX_MONOTONIC_CLOCK
94-
#define _POSIX_MONOTONIC_CLOCK _POSIX_VERSION
95-
#endif
96-
9785
/* #define _POSIX_PRIORITIZED_IO (-1L) */
9886

9987
#ifdef CONFIG_POSIX_PRIORITY_SCHEDULING
@@ -108,7 +96,6 @@
10896
#define _POSIX_READER_WRITER_LOCKS _POSIX_VERSION
10997
#endif
11098

111-
/* #define _POSIX_REALTIME_SIGNALS (-1L) */
11299
/* #define _POSIX_REGEXP (-1L) */
113100
/* #define _POSIX_SAVED_IDS (-1L) */
114101

@@ -161,10 +148,6 @@
161148
/* #define _POSIX_THREAD_ROBUST_PRIO_INHERIT (-1L) */
162149
/* #define _POSIX_THREAD_ROBUST_PRIO_PROTECT (-1L) */
163150

164-
#ifdef CONFIG_POSIX_THREAD_SAFE_FUNCTIONS
165-
#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
166-
#endif
167-
168151
/* #define _POSIX_THREAD_SPORADIC_SERVER (-1L) */
169152

170153
#ifdef CONFIG_POSIX_THREADS
@@ -177,10 +160,6 @@
177160
#define _POSIX_TIMEOUTS _POSIX_VERSION
178161
#endif
179162

180-
#ifdef CONFIG_POSIX_TIMERS
181-
#define _POSIX_TIMERS _POSIX_VERSION
182-
#endif
183-
184163
/* #define _POSIX_TRACE (-1L) */
185164
/* #define _POSIX_TRACE_EVENT_FILTER (-1L) */
186165
/* #define _POSIX_TRACE_INHERIT (-1L) */

include/zephyr/posix/pthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
#include <stdlib.h>
1111
#include <string.h>
12+
#include <time.h>
1213

1314
#include <zephyr/kernel.h>
14-
#include <zephyr/posix/time.h>
1515
#include <zephyr/posix/unistd.h>
1616
#include <zephyr/posix/sched.h>
1717

include/zephyr/posix/semaphore.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#ifndef ZEPHYR_INCLUDE_POSIX_SEMAPHORE_H_
77
#define ZEPHYR_INCLUDE_POSIX_SEMAPHORE_H_
88

9-
#include <zephyr/posix/time.h>
9+
#include <time.h>
10+
1011
#include <zephyr/posix/posix_types.h>
1112

1213
#ifdef __cplusplus

include/zephyr/posix/signal.h

Lines changed: 0 additions & 148 deletions
This file was deleted.

include/zephyr/posix/time.h

Lines changed: 0 additions & 114 deletions
This file was deleted.

include/zephyr/posix/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#ifndef ZEPHYR_INCLUDE_POSIX_UNISTD_H_
77
#define ZEPHYR_INCLUDE_POSIX_UNISTD_H_
88

9+
#include <time.h>
10+
911
#include <zephyr/posix/posix_types.h>
1012

1113
#ifdef CONFIG_POSIX_API

0 commit comments

Comments
 (0)