Skip to content

Commit 733c089

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 <cfriedt@tenstorrent.com>
1 parent fcb8798 commit 733c089

File tree

141 files changed

+287
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+287
-260
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
@@ -1133,10 +1133,15 @@ if NXP_WIFI_SMOKE_TESTS
11331133

11341134
config NXP_WIFI_SIGMA_AGENT
11351135
bool "Wi-Fi Alliance Sigma Agent Support"
1136-
select POSIX_API
1137-
select POSIX_THREADS
1136+
select POSIX_SYSTEM_INTERFACES
1137+
select POSIX_BASE_DEFINITIONS
1138+
select POSIX_AEP_REALTIME_MINIMAL
1139+
select POSIX_NETWORKING
1140+
imply EVENTFD
1141+
imply POSIX_FD_MGMT
1142+
imply POSIX_MULTI_PROCESS
1143+
imply XSI_SINGLE_PROCESS
11381144
select PTHREAD_CREATE_BARRIER
1139-
select POSIX_TIMERS
11401145
help
11411146
This option is to enable Wi-Fi Alliance Sigma Agent support in the Wi-Fi driver.
11421147

include/zephyr/net/socket.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ __syscall void *zsock_get_context_object(int sock);
374374
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html
375375
* for normative description.
376376
* This function is also exposed as `socket()`
377-
* if @kconfig{CONFIG_POSIX_API} is defined.
377+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
378378
*
379379
* If CONFIG_USERSPACE is enabled, the caller will be granted access to the
380380
* context object associated with the returned file descriptor.
@@ -391,7 +391,7 @@ __syscall int zsock_socket(int family, int type, int proto);
391391
* https://pubs.opengroup.org/onlinepubs/009695399/functions/socketpair.html
392392
* for normative description.
393393
* This function is also exposed as `socketpair()`
394-
* if @kconfig{CONFIG_POSIX_API} is defined.
394+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
395395
*/
396396
__syscall int zsock_socketpair(int family, int type, int proto, int *sv);
397397

@@ -401,7 +401,7 @@ __syscall int zsock_socketpair(int family, int type, int proto, int *sv);
401401
* @details
402402
* Close a network socket.
403403
* This function is also exposed as `close()`
404-
* if @kconfig{CONFIG_POSIX_API} is defined (in which case it
404+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined (in which case it
405405
* may conflict with generic POSIX `close()` function).
406406
*/
407407
__syscall int zsock_close(int sock);
@@ -415,7 +415,7 @@ __syscall int zsock_close(int sock);
415415
* for normative description, but currently this function has no effect in
416416
* Zephyr and provided solely for compatibility with existing code.
417417
* This function is also exposed as `shutdown()`
418-
* if @kconfig{CONFIG_POSIX_API} is defined.
418+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
419419
*/
420420
__syscall int zsock_shutdown(int sock, int how);
421421

@@ -427,7 +427,7 @@ __syscall int zsock_shutdown(int sock, int how);
427427
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html
428428
* for normative description.
429429
* This function is also exposed as `bind()`
430-
* if @kconfig{CONFIG_POSIX_API} is defined.
430+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
431431
*/
432432
__syscall int zsock_bind(int sock, const struct sockaddr *addr,
433433
socklen_t addrlen);
@@ -440,7 +440,7 @@ __syscall int zsock_bind(int sock, const struct sockaddr *addr,
440440
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html
441441
* for normative description.
442442
* This function is also exposed as `connect()`
443-
* if @kconfig{CONFIG_POSIX_API} is defined.
443+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
444444
*/
445445
__syscall int zsock_connect(int sock, const struct sockaddr *addr,
446446
socklen_t addrlen);
@@ -453,7 +453,7 @@ __syscall int zsock_connect(int sock, const struct sockaddr *addr,
453453
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/listen.html
454454
* for normative description.
455455
* This function is also exposed as `listen()`
456-
* if @kconfig{CONFIG_POSIX_API} is defined.
456+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
457457
*/
458458
__syscall int zsock_listen(int sock, int backlog);
459459

@@ -465,7 +465,7 @@ __syscall int zsock_listen(int sock, int backlog);
465465
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/accept.html
466466
* for normative description.
467467
* This function is also exposed as `accept()`
468-
* if @kconfig{CONFIG_POSIX_API} is defined.
468+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
469469
*/
470470
__syscall int zsock_accept(int sock, struct sockaddr *addr, socklen_t *addrlen);
471471

@@ -477,7 +477,7 @@ __syscall int zsock_accept(int sock, struct sockaddr *addr, socklen_t *addrlen);
477477
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
478478
* for normative description.
479479
* This function is also exposed as `sendto()`
480-
* if @kconfig{CONFIG_POSIX_API} is defined.
480+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
481481
*/
482482
__syscall ssize_t zsock_sendto(int sock, const void *buf, size_t len,
483483
int flags, const struct sockaddr *dest_addr,
@@ -491,7 +491,7 @@ __syscall ssize_t zsock_sendto(int sock, const void *buf, size_t len,
491491
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html
492492
* for normative description.
493493
* This function is also exposed as `send()`
494-
* if @kconfig{CONFIG_POSIX_API} is defined.
494+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
495495
*/
496496
static inline ssize_t zsock_send(int sock, const void *buf, size_t len,
497497
int flags)
@@ -507,7 +507,7 @@ static inline ssize_t zsock_send(int sock, const void *buf, size_t len,
507507
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/sendmsg.html
508508
* for normative description.
509509
* This function is also exposed as `sendmsg()`
510-
* if @kconfig{CONFIG_POSIX_API} is defined.
510+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
511511
*/
512512
__syscall ssize_t zsock_sendmsg(int sock, const struct msghdr *msg,
513513
int flags);
@@ -520,7 +520,7 @@ __syscall ssize_t zsock_sendmsg(int sock, const struct msghdr *msg,
520520
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html
521521
* for normative description.
522522
* This function is also exposed as `recvfrom()`
523-
* if @kconfig{CONFIG_POSIX_API} is defined.
523+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
524524
*/
525525
__syscall ssize_t zsock_recvfrom(int sock, void *buf, size_t max_len,
526526
int flags, struct sockaddr *src_addr,
@@ -534,7 +534,7 @@ __syscall ssize_t zsock_recvfrom(int sock, void *buf, size_t max_len,
534534
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html
535535
* for normative description.
536536
* This function is also exposed as `recvmsg()`
537-
* if @kconfig{CONFIG_POSIX_API} is defined.
537+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
538538
*/
539539
__syscall ssize_t zsock_recvmsg(int sock, struct msghdr *msg, int flags);
540540

@@ -546,7 +546,7 @@ __syscall ssize_t zsock_recvmsg(int sock, struct msghdr *msg, int flags);
546546
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html
547547
* for normative description.
548548
* This function is also exposed as `recv()`
549-
* if @kconfig{CONFIG_POSIX_API} is defined.
549+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
550550
*/
551551
static inline ssize_t zsock_recv(int sock, void *buf, size_t max_len,
552552
int flags)
@@ -561,7 +561,7 @@ static inline ssize_t zsock_recv(int sock, void *buf, size_t max_len,
561561
* This functions allow to (only) configure a socket for blocking or
562562
* non-blocking operation (O_NONBLOCK).
563563
* This function is also exposed as `fcntl()`
564-
* if @kconfig{CONFIG_POSIX_API} is defined (in which case
564+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined (in which case
565565
* it may conflict with generic POSIX `fcntl()` function).
566566
*/
567567
__syscall int zsock_fcntl_impl(int sock, int cmd, int flags);
@@ -599,7 +599,7 @@ static inline int zsock_fcntl_wrapper(int sock, int cmd, ...)
599599
* `ZFD_IOCTL_FIONREAD`, to set non-blocking mode, and query the number of
600600
* bytes available to read, respectively.
601601
* This function is also exposed as `ioctl()`
602-
* if @kconfig{CONFIG_POSIX_API} is defined (in which case
602+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined (in which case
603603
* it may conflict with generic POSIX `ioctl()` function).
604604
*/
605605
__syscall int zsock_ioctl_impl(int sock, unsigned long request, va_list ap);
@@ -630,7 +630,7 @@ static inline int zsock_ioctl_wrapper(int sock, unsigned long request, ...)
630630
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html
631631
* for normative description.
632632
* This function is also exposed as `poll()`
633-
* if @kconfig{CONFIG_POSIX_API} is defined (in which case
633+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined (in which case
634634
* it may conflict with generic POSIX `poll()` function).
635635
*/
636636
static inline int zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout)
@@ -649,7 +649,7 @@ static inline int zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout)
649649
* available in Linux (some options are dummy and provided to ease porting
650650
* of existing code).
651651
* This function is also exposed as `getsockopt()`
652-
* if @kconfig{CONFIG_POSIX_API} is defined.
652+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
653653
*/
654654
__syscall int zsock_getsockopt(int sock, int level, int optname,
655655
void *optval, socklen_t *optlen);
@@ -665,7 +665,7 @@ __syscall int zsock_getsockopt(int sock, int level, int optname,
665665
* available in Linux (some options are dummy and provided to ease porting
666666
* of existing code).
667667
* This function is also exposed as `setsockopt()`
668-
* if @kconfig{CONFIG_POSIX_API} is defined.
668+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
669669
*/
670670
__syscall int zsock_setsockopt(int sock, int level, int optname,
671671
const void *optval, socklen_t optlen);
@@ -678,7 +678,7 @@ __syscall int zsock_setsockopt(int sock, int level, int optname,
678678
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html
679679
* for normative description.
680680
* This function is also exposed as `getpeername()`
681-
* if @kconfig{CONFIG_POSIX_API} is defined.
681+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
682682
*/
683683
__syscall int zsock_getpeername(int sock, struct sockaddr *addr,
684684
socklen_t *addrlen);
@@ -691,7 +691,7 @@ __syscall int zsock_getpeername(int sock, struct sockaddr *addr,
691691
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html
692692
* for normative description.
693693
* This function is also exposed as `getsockname()`
694-
* if @kconfig{CONFIG_POSIX_API} is defined.
694+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
695695
*/
696696
__syscall int zsock_getsockname(int sock, struct sockaddr *addr,
697697
socklen_t *addrlen);
@@ -704,7 +704,7 @@ __syscall int zsock_getsockname(int sock, struct sockaddr *addr,
704704
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html
705705
* for normative description.
706706
* This function is also exposed as `gethostname()`
707-
* if @kconfig{CONFIG_POSIX_API} is defined.
707+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
708708
*/
709709
__syscall int zsock_gethostname(char *buf, size_t len);
710710

@@ -716,7 +716,7 @@ __syscall int zsock_gethostname(char *buf, size_t len);
716716
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html
717717
* for normative description.
718718
* This function is also exposed as `inet_ntop()`
719-
* if @kconfig{CONFIG_POSIX_API} is defined.
719+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
720720
*/
721721
static inline char *zsock_inet_ntop(sa_family_t family, const void *src,
722722
char *dst, size_t size)
@@ -732,7 +732,7 @@ static inline char *zsock_inet_ntop(sa_family_t family, const void *src,
732732
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_pton.html
733733
* for normative description.
734734
* This function is also exposed as `inet_pton()`
735-
* if @kconfig{CONFIG_POSIX_API} is defined.
735+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
736736
*/
737737
__syscall int zsock_inet_pton(sa_family_t family, const char *src, void *dst);
738738

@@ -775,7 +775,7 @@ __syscall int z_zsock_getaddrinfo_internal(const char *host,
775775
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html
776776
* for normative description.
777777
* This function is also exposed as `getaddrinfo()`
778-
* if @kconfig{CONFIG_POSIX_API} is defined.
778+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
779779
*/
780780
int zsock_getaddrinfo(const char *host, const char *service,
781781
const struct zsock_addrinfo *hints,
@@ -789,7 +789,7 @@ int zsock_getaddrinfo(const char *host, const char *service,
789789
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/freeaddrinfo.html
790790
* for normative description.
791791
* This function is also exposed as `freeaddrinfo()`
792-
* if @kconfig{CONFIG_POSIX_API} is defined.
792+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
793793
*/
794794
void zsock_freeaddrinfo(struct zsock_addrinfo *ai);
795795

@@ -801,7 +801,7 @@ void zsock_freeaddrinfo(struct zsock_addrinfo *ai);
801801
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/gai_strerror.html
802802
* for normative description.
803803
* This function is also exposed as `gai_strerror()`
804-
* if @kconfig{CONFIG_POSIX_API} is defined.
804+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
805805
*/
806806
const char *zsock_gai_strerror(int errcode);
807807

@@ -836,7 +836,7 @@ const char *zsock_gai_strerror(int errcode);
836836
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/getnameinfo.html
837837
* for normative description.
838838
* This function is also exposed as `getnameinfo()`
839-
* if @kconfig{CONFIG_POSIX_API} is defined.
839+
* if @kconfig{CONFIG_POSIX_NETWORKING} is defined.
840840
*/
841841
int zsock_getnameinfo(const struct sockaddr *addr, socklen_t addrlen,
842842
char *host, socklen_t hostlen,
@@ -1278,7 +1278,7 @@ struct socket_op_vtable {
12781278
* Additionally, if non-zephyr-prefixed headers are used here,
12791279
* native_sim pulls in those from the host rather than Zephyr's.
12801280
*/
1281-
#if defined(CONFIG_POSIX_API)
1281+
#if defined(CONFIG_POSIX_NETWORKING)
12821282
#if !defined(ZEPHYR_INCLUDE_POSIX_ARPA_INET_H_)
12831283
#include <arpa/inet.h>
12841284
#endif
@@ -1294,6 +1294,6 @@ struct socket_op_vtable {
12941294
#if !defined(ZEPHYR_INCLUDE_POSIX_SYS_SOCKET_H_)
12951295
#include <sys/socket.h>
12961296
#endif
1297-
#endif /* CONFIG_POSIX_API */
1297+
#endif /* CONFIG_POSIX_NETWORKING */
12981298

12991299
#endif /* ZEPHYR_INCLUDE_NET_SOCKET_H_ */

0 commit comments

Comments
 (0)