Skip to content

Commit fcebe60

Browse files
cfriedtdleach02
authored andcommitted
posix: deprecate PTHREAD_IPC _MUTEX _COND and _KEY
Zephyr's POSIX API is moving toward using the standard nomenclature from IEEE 1003.1-2017 for as much as possible. In particular, we want to have consistent naming between Zephyr's POSIX API Kconfig options and the naming for POSIX Options and Option Groups. The Kconfig option CONFIG_PTHREAD_IPC has been (ab)used for a very long time for a variety of different purposes. However, the standard Option / feature test macro for POSIX Threads is, intuitively _POSIX_THREADS. There is a corresponding sysconf() key named _SC_POSIX_THREADS. Annoyingly, the POSIX Option Group that corresponds to the Option is POSIX_THREADS_BASE, which is a minor inconsistency in the standard. The _POSIX_THREADS Option already includes mutexes, condition variables, and thread-specific storage (keys). So with this change, we also deprecate the redundant Kconfig variables that do not have a corresponding match in the standard. - CONFIG_PTHREAD_IPC - CONFIG_PTHREAD - CONFIG_PTHREAD_COND - CONFIG_PTHREAD_MUTEX - CONFIG_PTHREAD_KEY Additionally, create Kconfig variables for those configurables which we are lacking: - CONFIG_POSIX_THREADS_EXT - CONFIG_POSIX_THREAD_ATTR_STACKSIZE - CONFIG_POSIX_THREAD_ATTR_STACKADDR - CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING - CONFIG_POSIX_THREAD_PRIO_INHERIT - CONFIG_POSIX_THREAD_PRIO_PROTECT - CONFIG_POSIX_THREAD_SAFE_FUNCTIONS Some Kconfig variables were renamed to more properly match the spec: - CONFIG_MAX_PTHREAD_COUNT -> CONFIG_POSIX_THREAD_THREADS_MAX - CONFIG_MAX_PTHREAD_KEY_COUNT -> CONFIG_POSIX_THREAD_KEYS_MAX Signed-off-by: Chris Friedt <[email protected]>
1 parent 2f2cad7 commit fcebe60

36 files changed

+349
-211
lines changed

doc/services/portability/posix/aep/index.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ The *Minimal Realtime System Profile* (PSE51) includes all of the
5353
:ref:`POSIX_DEVICE_IO <posix_option_group_device_io>`,, :kconfig:option:`CONFIG_POSIX_DEVICE_IO`
5454
:ref:`POSIX_SIGNALS <posix_option_group_signals>`,,
5555
:ref:`POSIX_SINGLE_PROCESS <posix_option_group_single_process>`, yes, :kconfig:option:`CONFIG_POSIX_SINGLE_PROCESS`
56-
:ref:`POSIX_THREADS_BASE <posix_option_group_threads_base>`, yes,
57-
:ref:`XSI_THREADS_EXT <posix_option_group_xsi_threads_ext>`, yes,
56+
:ref:`XSI_THREADS_EXT <posix_option_group_xsi_threads_ext>`, yes, :kconfig:option:`CONFIG_XSI_THREADS_EXT`
5857

5958
.. csv-table:: PSE51 Option Requirements
6059
:header: Symbol, Support, Remarks
@@ -66,12 +65,12 @@ The *Minimal Realtime System Profile* (PSE51) includes all of the
6665
:ref:`_POSIX_MONOTONIC_CLOCK <posix_option_monotonic_clock>`, 200809L, :kconfig:option:`CONFIG_POSIX_MONOTONIC_CLOCK`
6766
:ref:`_POSIX_SHARED_MEMORY_OBJECTS <posix_shared_memory_objects>`, -1,
6867
:ref:`_POSIX_SYNCHRONIZED_IO <posix_option_synchronized_io>`, -1, :kconfig:option:`CONFIG_POSIX_SYNCHRONIZED_IO`
69-
:ref:`_POSIX_THREAD_ATTR_STACKADDR<posix_option_thread_attr_stackaddr>`, 200809L, :kconfig:option:`CONFIG_PTHREAD`
70-
:ref:`_POSIX_THREAD_ATTR_STACKSIZE<posix_option_thread_attr_stacksize>`, 200809L, :kconfig:option:`CONFIG_PTHREAD`
68+
:ref:`_POSIX_THREAD_ATTR_STACKADDR<posix_option_thread_attr_stackaddr>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKADDR`
69+
:ref:`_POSIX_THREAD_ATTR_STACKSIZE<posix_option_thread_attr_stacksize>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKSIZE`
7170
:ref:`_POSIX_THREAD_CPUTIME <posix_option_thread_cputime>`, 200809L, :kconfig:option:`CONFIG_POSIX_CPUTIME`
72-
_POSIX_THREAD_PRIO_INHERIT, 200809L, :kconfig:option:`CONFIG_PTHREAD_MUTEX`
73-
_POSIX_THREAD_PRIO_PROTECT, -1,
74-
:ref:`_POSIX_THREAD_PRIORITY_SCHEDULING<posix_option_thread_priority_scheduling>`, 200809L, :kconfig:option:`CONFIG_POSIX_PRIORITY_SCHEDULING`
71+
:ref:`_POSIX_THREAD_PRIO_INHERIT <posix_option_thread_prio_inherit>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_PRIO_INHERIT`
72+
:ref:`_POSIX_THREAD_PRIO_PROTECT <posix_option_thread_prio_protect>`, -1, :kconfig:option:`CONFIG_POSIX_THREAD_PRIO_PROTECT`
73+
:ref:`_POSIX_THREAD_PRIORITY_SCHEDULING <posix_option_thread_priority_scheduling>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING`
7574
_POSIX_THREAD_SPORADIC_SERVER, -1,
7675

7776
.. _posix_aep_pse52:

doc/services/portability/posix/conformance/index.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ POSIX System Interfaces
7070
:ref:`_POSIX_REALTIME_SIGNALS<posix_option_group_realtime_signals>`, -1,
7171
:ref:`_POSIX_SEMAPHORES<posix_option_group_semaphores>`, 200809L, :kconfig:option:`CONFIG_POSIX_SEMAPHORES`
7272
:ref:`_POSIX_SPIN_LOCKS<posix_option_group_spin_locks>`, 200809L, :kconfig:option:`CONFIG_POSIX_SPIN_LOCKS`
73-
:ref:`_POSIX_THREAD_SAFE_FUNCTIONS<posix_thread_safe_functions>`, -1,
74-
:ref:`_POSIX_THREADS<posix_option_group_threads_base>`, -1, :kconfig:option:`CONFIG_PTHREAD_IPC`
73+
:ref:`_POSIX_THREAD_SAFE_FUNCTIONS<posix_thread_safe_functions>`, -1, :kconfig:option:`CONFIG_POSIX_THREAD_SAFE_FUNCTIONS`
74+
:ref:`_POSIX_THREADS<posix_option_group_threads_base>`, -1, :kconfig:option:`CONFIG_POSIX_THREADS`
7575
:ref:`_POSIX_TIMEOUTS<posix_option_timeouts>`, 200809L, :kconfig:option:`CONFIG_POSIX_TIMEOUTS`
7676
:ref:`_POSIX_TIMERS<posix_option_group_timers>`, 200809L, :kconfig:option:`CONFIG_POSIX_TIMERS`
7777
_POSIX2_C_BIND, 200809L,
@@ -95,12 +95,12 @@ POSIX System Interfaces
9595
_POSIX_SPAWN, -1, :ref:`†<posix_undefined_behaviour>`
9696
_POSIX_SPORADIC_SERVER, -1, :ref:`†<posix_undefined_behaviour>`
9797
:ref:`_POSIX_SYNCHRONIZED_IO <posix_option_synchronized_io>`, -1, :kconfig:option:`CONFIG_POSIX_SYNCHRONIZED_IO`
98-
:ref:`_POSIX_THREAD_ATTR_STACKADDR<posix_option_thread_attr_stackaddr>`, 200809L, :kconfig:option:`CONFIG_PTHREAD`
99-
:ref:`_POSIX_THREAD_ATTR_STACKSIZE<posix_option_thread_attr_stacksize>`, 200809L, :kconfig:option:`CONFIG_PTHREAD`
98+
:ref:`_POSIX_THREAD_ATTR_STACKADDR<posix_option_thread_attr_stackaddr>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKADDR`
99+
:ref:`_POSIX_THREAD_ATTR_STACKSIZE<posix_option_thread_attr_stacksize>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKSIZE`
100100
:ref:`_POSIX_THREAD_CPUTIME <posix_option_thread_cputime>`, 200809L, :kconfig:option:`CONFIG_POSIX_CPUTIME`
101-
_POSIX_THREAD_PRIO_INHERIT, 200809L, :kconfig:option:`CONFIG_PTHREAD_MUTEX`
102-
_POSIX_THREAD_PRIO_PROTECT, -1,
103-
:ref:`_POSIX_THREAD_PRIORITY_SCHEDULING<posix_option_thread_priority_scheduling>`, 200809L, :kconfig:option:`CONFIG_PTHREAD`
101+
:ref:`_POSIX_THREAD_PRIO_INHERIT <posix_option_thread_prio_inherit>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_PRIO_INHERIT`
102+
:ref:`_POSIX_THREAD_PRIO_PROTECT <posix_option_thread_prio_protect>`, -1, :kconfig:option:`CONFIG_POSIX_THREAD_PRIO_PROTECT`
103+
:ref:`_POSIX_THREAD_PRIORITY_SCHEDULING <posix_option_thread_priority_scheduling>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING`
104104
_POSIX_THREAD_PROCESS_SHARED, -1,
105105
_POSIX_THREAD_SPORADIC_SERVER, -1,
106106
_POSIX_TRACE, -1,
@@ -149,8 +149,8 @@ XSI System Interfaces
149149
:widths: 50, 10, 50
150150

151151
:ref:`_POSIX_FSYNC<posix_option_fsync>`, 200809L, :kconfig:option:`CONFIG_POSIX_FSYNC`
152-
:ref:`_POSIX_THREAD_ATTR_STACKADDR<posix_option_thread_attr_stackaddr>`, 200809L, :kconfig:option:`CONFIG_PTHREAD`
153-
:ref:`_POSIX_THREAD_ATTR_STACKSIZE<posix_option_thread_attr_stacksize>`, 200809L, :kconfig:option:`CONFIG_PTHREAD`
152+
:ref:`_POSIX_THREAD_ATTR_STACKADDR<posix_option_thread_attr_stackaddr>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKADDR`
153+
:ref:`_POSIX_THREAD_ATTR_STACKSIZE<posix_option_thread_attr_stacksize>`, 200809L, :kconfig:option:`CONFIG_POSIX_THREAD_ATTR_STACKSIZE`
154154
_POSIX_THREAD_PROCESS_SHARED, -1,
155155

156156
.. _CX: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap01.html

doc/services/portability/posix/kconfig/index.rst

+5-8
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ implementation of the POSIX API.
1010
* :kconfig:option:`CONFIG_EVENTFD_MAX`
1111
* :kconfig:option:`CONFIG_FDTABLE`
1212
* :kconfig:option:`CONFIG_GETOPT_LONG`
13-
* :kconfig:option:`CONFIG_MAX_PTHREAD_COUNT`
14-
* :kconfig:option:`CONFIG_MAX_PTHREAD_KEY_COUNT`
15-
* :kconfig:option:`CONFIG_MAX_PTHREAD_MUTEX_COUNT`
1613
* :kconfig:option:`CONFIG_MAX_PTHREAD_SPINLOCK_COUNT`
1714
* :kconfig:option:`CONFIG_MQUEUE_NAMELEN_MAX`
1815
* :kconfig:option:`CONFIG_POSIX_MQ_OPEN_MAX`
@@ -23,17 +20,17 @@ implementation of the POSIX API.
2320
* :kconfig:option:`CONFIG_POSIX_API`
2421
* :kconfig:option:`CONFIG_ZVFS_OPEN_MAX`
2522
* :kconfig:option:`CONFIG_POSIX_OPEN_MAX`
23+
* :kconfig:option:`CONFIG_POSIX_PTHREAD_ATTR_GUARDSIZE_BITS`
24+
* :kconfig:option:`CONFIG_POSIX_PTHREAD_ATTR_GUARDSIZE_DEFAULT`
25+
* :kconfig:option:`CONFIG_POSIX_PTHREAD_ATTR_STACKSIZE_BITS`
2626
* :kconfig:option:`CONFIG_POSIX_RTSIG_MAX`
2727
* :kconfig:option:`CONFIG_POSIX_SIGNAL`
2828
* :kconfig:option:`CONFIG_POSIX_SIGNAL_STRING_DESC`
29+
* :kconfig:option:`CONFIG_POSIX_THREAD_KEYS_MAX`
30+
* :kconfig:option:`CONFIG_POSIX_THREAD_THREADS_MAX`
2931
* :kconfig:option:`CONFIG_POSIX_UNAME_NODENAME_LEN`
3032
* :kconfig:option:`CONFIG_POSIX_UNAME_VERSION_LEN`
31-
* :kconfig:option:`CONFIG_PTHREAD`
32-
* :kconfig:option:`CONFIG_PTHREAD_COND`
3333
* :kconfig:option:`CONFIG_PTHREAD_CREATE_BARRIER`
34-
* :kconfig:option:`CONFIG_PTHREAD_IPC`
35-
* :kconfig:option:`CONFIG_PTHREAD_KEY`
36-
* :kconfig:option:`CONFIG_PTHREAD_MUTEX`
3734
* :kconfig:option:`CONFIG_PTHREAD_RECYCLER_DELAY_MS`
3835
* :kconfig:option:`CONFIG_POSIX_SEM_NAMELEN_MAX`
3936
* :kconfig:option:`CONFIG_POSIX_SEM_NSEMS_MAX`

doc/services/portability/posix/option_groups/index.rst

+28
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,34 @@ _POSIX_THREAD_PRIORITY_SCHEDULING
778778
pthread_setschedparam(),yes
779779
pthread_setschedprio(),yes
780780

781+
.. _posix_option_thread_prio_inherit:
782+
783+
_POSIX_THREAD_PRIO_INHERIT
784+
++++++++++++++++++++++++++
785+
786+
.. csv-table:: _POSIX_THREAD_PRIO_INHERIT
787+
:header: API, Supported
788+
:widths: 50,10
789+
790+
pthread_mutexattr_getprotocol(),yes
791+
pthread_mutexattr_setprotocol(),yes
792+
793+
.. _posix_option_thread_prio_protect:
794+
795+
_POSIX_THREAD_PRIO_PROTECT
796+
++++++++++++++++++++++++++
797+
798+
.. csv-table:: _POSIX_THREAD_PRIO_PROTECT
799+
:header: API, Supported
800+
:widths: 50,10
801+
802+
pthread_mutex_getprioceiling(),
803+
pthread_mutex_setprioceiling(),
804+
pthread_mutexattr_getprioceiling(),
805+
pthread_mutexattr_getprotocol(),yes
806+
pthread_mutexattr_setprioceiling(),
807+
pthread_mutexattr_setprotocol(),yes
808+
781809
.. _posix_thread_safe_functions:
782810

783811
_POSIX_THREAD_SAFE_FUNCTIONS

doc/services/portability/posix/overview/index.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ feature selection at various levels of granularity.
129129
Alternatively, users may enable one of the Kconfig options below as a shortcut to enable multiple
130130
:ref:`Option Groups<posix_option_groups>`.
131131

132-
* :kconfig:option:`CONFIG_POSIX_API`
133-
* :kconfig:option:`CONFIG_PTHREAD_IPC`
132+
* :kconfig:option:`CONFIG_POSIX_API` - Enables all implemented POSIX API Options and Option Groups
134133

135134
.. note::
136135
Since the POSIX environment in Zephyr is fully configurable via :ref:`Kconfig<kconfig>`,

include/zephyr/posix/posix_features.h

+15-9
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,41 @@
9494
/* #define _POSIX_SPORADIC_SERVER (-1L) */
9595
/* #define _POSIX_SYNCHRONIZED_IO (-1L) */
9696

97-
#ifdef CONFIG_PTHREAD_IPC
97+
#ifdef CONFIG_POSIX_THREAD_ATTR_STACKADDR
9898
#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
9999
#endif
100100

101-
#ifdef CONFIG_PTHREAD_IPC
101+
#ifdef CONFIG_POSIX_THREAD_ATTR_STACKSIZE
102102
#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
103103
#endif
104104

105105
#ifdef CONFIG_POSIX_THREAD_CPUTIME
106106
#define _POSIX_THREAD_CPUTIME _POSIX_VERSION
107107
#endif
108108

109-
#ifdef CONFIG_PTHREAD_IPC
109+
#ifdef CONFIG_POSIX_THREAD_PRIO_INHERIT
110110
#define _POSIX_THREAD_PRIO_INHERIT _POSIX_VERSION
111111
#endif
112112

113-
/* #define _POSIX_THREAD_PRIO_PROTECT (-1L) */
114-
/* #define _POSIX_THREAD_PRIORITY_SCHEDULING (-1L) */
113+
#ifdef CONFIG_POSIX_THREAD_PRIO_PROTECT
114+
#define _POSIX_THREAD_PRIO_PROTECT _POSIX_VERSION
115+
#endif
116+
117+
#ifdef CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING
118+
#define _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_VERSION
119+
#endif
120+
115121
/* #define _POSIX_THREAD_PROCESS_SHARED (-1L) */
116122
/* #define _POSIX_THREAD_ROBUST_PRIO_INHERIT (-1L) */
117123
/* #define _POSIX_THREAD_ROBUST_PRIO_PROTECT (-1L) */
118124

119-
#ifdef CONFIG_PTHREAD_IPC
125+
#ifdef CONFIG_POSIX_THREAD_SAFE_FUNCTIONS
120126
#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
121127
#endif
122128

123129
/* #define _POSIX_THREAD_SPORADIC_SERVER (-1L) */
124130

125-
#ifdef CONFIG_PTHREAD_IPC
131+
#ifdef CONFIG_POSIX_THREADS
126132
#ifndef _POSIX_THREADS
127133
#define _POSIX_THREADS _POSIX_VERSION
128134
#endif
@@ -229,9 +235,9 @@
229235
#define _POSIX_SYMLOOP_MAX (8)
230236
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS (4)
231237
#define _POSIX_THREAD_KEYS_MAX \
232-
COND_CODE_1(CONFIG_PTHREAD_IPC, (CONFIG_MAX_PTHREAD_KEY_COUNT), (0))
238+
COND_CODE_1(CONFIG_POSIX_THREADS, (CONFIG_POSIX_THREAD_KEYS_MAX), (0))
233239
#define _POSIX_THREAD_THREADS_MAX \
234-
COND_CODE_1(CONFIG_PTHREAD_IPC, (CONFIG_MAX_PTHREAD_COUNT), (0))
240+
COND_CODE_1(CONFIG_POSIX_THREADS, (CONFIG_POSIX_THREAD_THREADS_MAX), (0))
235241
#define _POSIX_TIMER_MAX \
236242
COND_CODE_1(CONFIG_POSIX_TIMERS, (CONFIG_POSIX_TIMER_MAX), (0))
237243
#define _POSIX_TRACE_EVENT_NAME_MAX (30)

include/zephyr/posix/pthread.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ int pthread_attr_getscope(const pthread_attr_t *attr, int *contentionscope);
417417
int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope);
418418
int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inheritsched);
419419
int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched);
420-
#ifdef CONFIG_PTHREAD_IPC
420+
#ifdef CONFIG_POSIX_THREADS
421421
int pthread_once(pthread_once_t *once, void (*initFunc)(void));
422422
#endif
423423
FUNC_NORETURN void pthread_exit(void *retval);
@@ -502,7 +502,7 @@ int pthread_setname_np(pthread_t thread, const char *name);
502502
*/
503503
int pthread_getname_np(pthread_t thread, char *name, size_t len);
504504

505-
#ifdef CONFIG_PTHREAD_IPC
505+
#ifdef CONFIG_POSIX_THREADS
506506

507507
/**
508508
* @brief Destroy a pthread_spinlock_t.

include/zephyr/posix/sys/sysconf.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,24 @@ enum {
183183
#define __z_posix_sysconf_SC_SS_REPL_MAX _POSIX_SS_REPL_MAX
184184
#define __z_posix_sysconf_SC_SYNCHRONIZED_IO (-1L)
185185
#define __z_posix_sysconf_SC_THREAD_ATTR_STACKADDR \
186-
COND_CODE_1(CONFIG_PTHREAD_IPC, (_POSIX_THREAD_ATTR_STACKADDR), (-1))
186+
COND_CODE_1(CONFIG_POSIX_THREAD_ATTR_STACKADDR, (_POSIX_THREAD_ATTR_STACKADDR), (-1))
187187
#define __z_posix_sysconf_SC_THREAD_ATTR_STACKSIZE \
188-
COND_CODE_1(CONFIG_PTHREAD_IPC, (_POSIX_THREAD_ATTR_STACKSIZE), (-1L))
188+
COND_CODE_1(CONFIG_POSIX_THREAD_ATTR_STACKSIZE, (_POSIX_THREAD_ATTR_STACKSIZE), (-1L))
189189
#define __z_posix_sysconf_SC_THREAD_CPUTIME (-1L)
190190
#define __z_posix_sysconf_SC_THREAD_PRIO_INHERIT \
191-
COND_CODE_1(CONFIG_PTHREAD_IPC, (_POSIX_THREAD_PRIO_INHERIT), (-1L))
191+
COND_CODE_1(CONFIG_POSIX_THREAD_PRIO_INHERIT, (_POSIX_THREAD_PRIO_INHERIT), (-1L))
192192
#define __z_posix_sysconf_SC_THREAD_PRIO_PROTECT (-1L)
193-
#define __z_posix_sysconf_SC_THREAD_PRIORITY_SCHEDULING (-1L)
193+
#define __z_posix_sysconf_SC_THREAD_PRIORITY_SCHEDULING \
194+
COND_CODE_1(CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING, (_POSIX_THREAD_PRIORITY_SCHEDULING), \
195+
(-1L))
194196
#define __z_posix_sysconf_SC_THREAD_PROCESS_SHARED (-1L)
195197
#define __z_posix_sysconf_SC_THREAD_ROBUST_PRIO_INHERIT (-1L)
196198
#define __z_posix_sysconf_SC_THREAD_ROBUST_PRIO_PROTECT (-1L)
197199
#define __z_posix_sysconf_SC_THREAD_SAFE_FUNCTIONS \
198-
COND_CODE_1(CONFIG_PTHREAD_IPC, (_POSIX_THREAD_SAFE_FUNCTIONS), (-1L))
200+
COND_CODE_1(CONFIG_POSIX_THREAD_SAFE_FUNCTIONS, (_POSIX_THREAD_SAFE_FUNCTIONS), (-1L))
199201
#define __z_posix_sysconf_SC_THREAD_SPORADIC_SERVER (-1L)
200202
#define __z_posix_sysconf_SC_THREADS \
201-
COND_CODE_1(CONFIG_PTHREAD_IPC, (_POSIX_THREADS), (-1L))
203+
COND_CODE_1(CONFIG_POSIX_THREADS, (_POSIX_THREADS), (-1L))
202204
#define __z_posix_sysconf_SC_TIMEOUTS \
203205
COND_CODE_1(CONFIG_POSIX_TIMEOUTS, (_POSIX_TIMEOUTS), (-1L))
204206
#define __z_posix_sysconf_SC_TIMERS \

lib/posix/options/CMakeLists.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if(CONFIG_POSIX_SIGNAL)
2424
)
2525
endif()
2626

27-
if(CONFIG_POSIX_API OR CONFIG_PTHREAD_IPC OR CONFIG_POSIX_TIMERS OR
27+
if(CONFIG_POSIX_API OR CONFIG_POSIX_THREADS OR CONFIG_POSIX_TIMERS OR
2828
CONFIG_POSIX_MESSAGE_PASSING OR CONFIG_POSIX_FILE_SYSTEM OR CONFIG_EVENTFD OR
2929
CONFIG_POSIX_C_LIB_EXT OR CONFIG_POSIX_SINGLE_PROCESS)
3030
# This is a temporary workaround so that Newlib declares the appropriate
@@ -70,15 +70,17 @@ zephyr_library_sources_ifdef(CONFIG_POSIX_SYSLOG syslog.c)
7070
zephyr_library_sources_ifdef(CONFIG_POSIX_TIMERS
7171
clock.c
7272
timer.c
73+
timespec_to_timeout.c
7374
)
74-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC _common.c)
75-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_COND cond.c)
76-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_KEY key.c)
77-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_MUTEX mutex.c)
78-
zephyr_library_sources_ifdef(CONFIG_PTHREAD pthread.c)
7975
zephyr_library_sources_ifdef(CONFIG_POSIX_PRIORITY_SCHEDULING sched.c)
8076
zephyr_library_sources_ifdef(CONFIG_POSIX_READER_WRITER_LOCKS rwlock.c)
8177
zephyr_library_sources_ifdef(CONFIG_POSIX_SEMAPHORES semaphore.c)
78+
zephyr_library_sources_ifdef(CONFIG_POSIX_THREADS
79+
cond.c
80+
key.c
81+
mutex.c
82+
pthread.c
83+
)
8284
zephyr_library_sources_ifdef(CONFIG_XOPEN_STREAMS stropts.c)
8385
zephyr_library_sources_ifdef(CONFIG_XSI_SYSTEM_LOGGING syslog.c)
8486

lib/posix/options/Kconfig

-12
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,14 @@ config POSIX_API
1414
Enable mostly-standards-compliant implementations of
1515
various POSIX (IEEE 1003.1) APIs.
1616

17-
config PTHREAD_IPC
18-
bool "POSIX pthread IPC API"
19-
default y if POSIX_API
20-
depends on POSIX_TIMERS
21-
help
22-
This enables a mostly-standards-compliant implementation of
23-
the pthread mutex, condition variable and barrier IPC
24-
mechanisms.
25-
2617
rsource "Kconfig.aio"
2718
rsource "Kconfig.barrier"
28-
rsource "Kconfig.cond"
2919
rsource "Kconfig.c_lib_ext"
3020
rsource "Kconfig.device_io"
3121
rsource "Kconfig.fd_mgmt"
3222
rsource "Kconfig.fs"
33-
rsource "Kconfig.key"
3423
rsource "Kconfig.mem"
3524
rsource "Kconfig.mqueue"
36-
rsource "Kconfig.mutex"
3725
rsource "Kconfig.net"
3826
rsource "Kconfig.proc1"
3927
rsource "Kconfig.procN"

lib/posix/options/Kconfig.cond

-9
This file was deleted.

0 commit comments

Comments
 (0)