Skip to content

Commit 638cab4

Browse files
committed
posix: deprecate CONFIG_POSIX_API
This change deprecates the Kconfig option `CONFIG_POSIX_API`. It is slated for removal in Zephyr v4.5.0. Signed-off-by: Chris Friedt <[email protected]>
1 parent 5e7c76f commit 638cab4

File tree

10 files changed

+39
-34
lines changed

10 files changed

+39
-34
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ implementation of the POSIX API.
1919
* :kconfig:option:`CONFIG_NET_SOCKETS`
2020
* :kconfig:option:`CONFIG_ZVFS_POLL_MAX`
2121
* :kconfig:option:`CONFIG_ZVFS_OPEN_MAX`
22-
* :kconfig:option:`CONFIG_POSIX_API`
22+
* :kconfig:option:`CONFIG_POSIX_SYSTEM_INTERFACES`
2323
* :kconfig:option:`CONFIG_POSIX_OPEN_MAX`
2424
* :kconfig:option:`CONFIG_POSIX_PTHREAD_ATTR_GUARDSIZE_BITS`
2525
* :kconfig:option:`CONFIG_POSIX_PTHREAD_ATTR_GUARDSIZE_DEFAULT`

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

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ leverages the ``nanosleep()`` and ``perror()`` POSIX functions.
8585
.. code-block:: cfg
8686
:caption: `prj.conf` for a simple POSIX app in Zephyr
8787
88-
CONFIG_POSIX_API=y
88+
CONFIG_POSIX_AEP_REALTIME_MINIMAL=y
8989
9090
.. code-block:: c
91-
:caption: A simple app that uses Zephyr's POSIX API
91+
:caption: A simple app that uses the POSIX API
9292
9393
#include <stddef.h>
9494
#include <stdio.h>
@@ -128,38 +128,30 @@ explicitly choose to enable POSIX options via :ref:`Kconfig<kconfig>` selection.
128128
Subprofiles
129129
+++++++++++
130130

131-
Enable one of the Kconfig options below to quickly configure a pre-defined
131+
Applications should enable one of the Kconfig options below to quickly configure a pre-defined
132132
:ref:`POSIX subprofile <posix_subprofiles>`.
133133

134134
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_BASE` (:ref:`Base <posix_system_interfaces_required>`)
135135
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE51` (:ref:`PSE51 <posix_aep_pse51>`)
136136
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE52` (:ref:`PSE52 <posix_aep_pse52>`)
137137
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE53` (:ref:`PSE53 <posix_aep_pse53>`)
138138

139-
Additional POSIX :ref:`Options and Option Groups <posix_option_groups>` may be enabled as needed
140-
via Kconfig (e.g. ``CONFIG_POSIX_C_LIB_EXT=y``). Further fine-tuning may be accomplished via
141-
:ref:`additional POSIX-related Kconfig options <posix_kconfig_options>`.
139+
Libraries should depend on :kconfig:option:`CONFIG_POSIX_SYSTEM_INTERFACES` and other
140+
POSIX :ref:`Option Groups <posix_option_groups>`, as needed.
142141

143-
Subprofiles, Options, and Option Groups should be considered the preferred way to configure POSIX
144-
in Zephyr going forward.
142+
Further fine-tuning may be accomplished via
143+
:ref:`additional POSIX-related Kconfig options <posix_kconfig_options>`.
145144

146145
Legacy
147146
++++++
148147

149148
Historically, Zephyr used :kconfig:option:`CONFIG_POSIX_API` to configure a set of POSIX features
150149
that was overloaded and always increasing in size.
151150

152-
* :kconfig:option:`CONFIG_POSIX_API`
153-
154-
The option is now frozen, and can be considered equivalent to the following:
155-
156-
* :kconfig:option:`CONFIG_POSIX_AEP_CHOICE_PSE51`
157-
* :kconfig:option:`CONFIG_POSIX_FD_MGMT`
158-
* :kconfig:option:`CONFIG_POSIX_MESSAGE_PASSING`
159-
* :kconfig:option:`CONFIG_POSIX_NETWORKING`
151+
The :kconfig:option:`CONFIG_POSIX_API` is now deprecated and is slated for removal in Zephyr
152+
v4.5.0.
160153

161-
However, :kconfig:option:`CONFIG_POSIX_API` should be considered legacy and should not be used for
162-
new Zephyr applications.
154+
Applications should select a POSIX subprofile mentioned above.
163155

164156
.. _IEEE: https://www.ieee.org/
165157
.. _IEEE Computer Society: https://www.computer.org/

drivers/modem/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ config MODEM_SOCKET
158158
Note that the modem socket uses runtime allocated file descriptors
159159
reserved from the fdtable, for which the max count is set using the
160160
Kconfig option ZVFS_OPEN_MAX. Make sure to update this value as both
161-
the modem sockets and the POSIX_API, if used, share them.
161+
the modem sockets and other POSIX APIs, if used, share them.
162162

163163
config MODEM_SOCKET_PACKET_COUNT
164164
int "Maximum number of stored packet sizes per socket"

drivers/wifi/nxp/Kconfig.nxp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,10 +1112,15 @@ if NXP_WIFI_SMOKE_TESTS
11121112

11131113
config NXP_WIFI_SIGMA_AGENT
11141114
bool "Wi-Fi Alliance Sigma Agent Support"
1115-
select POSIX_API
1116-
select POSIX_THREADS
1115+
select POSIX_SYSTEM_INTERFACES
1116+
select POSIX_BASE_DEFINITIONS
1117+
select POSIX_AEP_REALTIME_MINIMAL
1118+
select POSIX_NETWORKING
1119+
imply EVENTFD
1120+
imply POSIX_FD_MGMT
1121+
imply POSIX_MULTI_PROCESS
1122+
imply XSI_SINGLE_PROCESS
11171123
select PTHREAD_CREATE_BARRIER
1118-
select POSIX_TIMERS
11191124
help
11201125
This option is to enable Wi-Fi Alliance Sigma Agent support in the Wi-Fi driver.
11211126

lib/libc/common/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ config COMMON_LIBC_STRNLEN
107107
config COMMON_LIBC_THRD
108108
bool "C11 <threads.h> API support"
109109
depends on DYNAMIC_THREAD
110-
# Note: the POSIX_API dependency is only necessary until common elements
110+
# Note: the POSIX_THREADS dependency is only necessary until common elements
111111
# of C11 threads and POSIX API can be abstracted out to a common library.
112-
depends on POSIX_API
112+
depends on POSIX_THREADS
113113
default y
114114
help
115115
Common implementation of C11 <threads.h> API.

lib/os/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ config ZVFS_OPEN_MAX
1414
int "Maximum number of open file descriptors"
1515
default 24 if NRF70_ENABLE_DUAL_VIF
1616
default 16 if WIFI_NM_WPA_SUPPLICANT
17-
default 16 if POSIX_API
17+
default 16 if POSIX_SYSTEM_INTERFACES
1818
default 4
1919
help
2020
Maximum number of open file descriptors, this includes

lib/posix/Kconfig.profile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ config POSIX_API
1212
imply POSIX_FD_MGMT # open(), close(), read(), write()
1313
imply POSIX_MULTI_PROCESS # sleep(), getpid(), etc
1414
imply XSI_SINGLE_PROCESS # gettimeofday()
15+
select DEPRECATED
1516
help
16-
This option enables the required POSIX System Interfaces (base definitions), all of PSE51,
17-
and some features found in PSE52.
17+
This option is deprecated. Applications should select CONFIG_POSIX_AEP_CHOICE_BASE,
18+
CONFIG_POSIX_AEP_CHOICE_PSE51, CONFIG_POSIX_AEP_CHOICE_PSE52, or
19+
CONFIG_POSIX_AEP_CHOICE_PSE53. Libraries should depend on
20+
CONFIG_POSIX_SYSTEM_INTERFACES and other POSIX Option Groups.
21+
22+
For more information, please see
1823

19-
Note: in the future, this option may be deprecated in favour of subprofiling options.
2024

2125
choice POSIX_AEP_CHOICE
2226
prompt "POSIX Subprofile"

lib/posix/options/Kconfig.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
menuconfig POSIX_FILE_SYSTEM
66
bool "POSIX file system API support"
7-
default y if POSIX_API
7+
default y if POSIX_SYSTEM_INTERFACES
88
select FILE_SYSTEM
99
select FDTABLE
1010
help

modules/hostap/Kconfig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77

88
config WIFI_NM_WPA_SUPPLICANT
99
bool "WPA Suplicant from hostap project [EXPERIMENTAL]"
10-
select POSIX_TIMERS
11-
select POSIX_SIGNALS
12-
select POSIX_API
10+
select POSIX_SYSTEM_INTERFACES
11+
select POSIX_BASE_DEFINITIONS
12+
select POSIX_AEP_REALTIME_MINIMAL
13+
select POSIX_NETWORKING
14+
imply EVENTFD
15+
imply POSIX_FD_MGMT
16+
imply POSIX_MULTI_PROCESS
1317
select XSI_SINGLE_PROCESS
1418
select NET_SOCKETS
1519
select NET_SOCKETS_PACKET

modules/thrift/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ menuconfig THRIFT
1010
depends on CPP
1111
depends on STD_CPP17
1212
depends on CPP_EXCEPTIONS
13-
depends on POSIX_API
13+
depends on POSIX_SYSTEM_INTERFACES
1414
help
1515
Enable this option to support Apache Thrift
1616

0 commit comments

Comments
 (0)