diff --git a/doc/services/portability/posix/conformance/index.rst b/doc/services/portability/posix/conformance/index.rst index 9eb2e0ae191..6a11f4d9172 100644 --- a/doc/services/portability/posix/conformance/index.rst +++ b/doc/services/portability/posix/conformance/index.rst @@ -111,7 +111,7 @@ POSIX System Interfaces _XOPEN_CRYPT, -1, _XOPEN_REALTIME, -1, _XOPEN_REALTIME_THREADS, -1, - :ref:`_XOPEN_STREAMS`, -1, :ref:`†` + :ref:`_XOPEN_STREAMS`, 200809L, :kconfig:option:`CONFIG_XOPEN_STREAMS` _XOPEN_UNIX, -1, POSIX Shell and Utilities diff --git a/include/zephyr/posix/posix_features.h b/include/zephyr/posix/posix_features.h index 96d98d0e0f5..d95ebf54948 100644 --- a/include/zephyr/posix/posix_features.h +++ b/include/zephyr/posix/posix_features.h @@ -186,7 +186,7 @@ /* #define _XOPEN_REALTIME (-1L) */ /* #define _XOPEN_REALTIME_THREADS (-1L) */ /* #define _XOPEN_SHM (-1L) */ -/* #define _XOPEN_STREAMS (-1L) */ +#define _XOPEN_STREAMS COND_CODE_1(CONFIG_XOPEN_STREAMS, (_XOPEN_VERSION), (-1)) /* #define _XOPEN_UNIX (-1L) */ /* #define _XOPEN_UUCP (-1L) */ diff --git a/include/zephyr/posix/sys/sysconf.h b/include/zephyr/posix/sys/sysconf.h index bc640938f38..812f3bf8c71 100644 --- a/include/zephyr/posix/sys/sysconf.h +++ b/include/zephyr/posix/sys/sysconf.h @@ -249,7 +249,8 @@ enum { #define __z_posix_sysconf_SC_XOPEN_REALTIME (-1L) #define __z_posix_sysconf_SC_XOPEN_REALTIME_THREADS (-1L) #define __z_posix_sysconf_SC_XOPEN_SHM (-1L) -#define __z_posix_sysconf_SC_XOPEN_STREAMS (-1L) +#define __z_posix_sysconf_SC_XOPEN_STREAMS \ + COND_CODE_1(CONFIG_XOPEN_STREAMS, (_POSIX_XOPEN_STREAMS), (-1)) #define __z_posix_sysconf_SC_XOPEN_UNIX (-1L) #define __z_posix_sysconf_SC_XOPEN_UUCP (-1L) #define __z_posix_sysconf_SC_XOPEN_VERSION _XOPEN_VERSION diff --git a/lib/posix/options/CMakeLists.txt b/lib/posix/options/CMakeLists.txt index f416ad3bf4e..443c0ad0182 100644 --- a/lib/posix/options/CMakeLists.txt +++ b/lib/posix/options/CMakeLists.txt @@ -58,7 +58,6 @@ zephyr_library_sources_ifdef(CONFIG_POSIX_MULTI_PROCESS sleep.c ) zephyr_library_sources_ifdef(CONFIG_POSIX_NETWORKING net.c) -zephyr_library_sources_ifdef(CONFIG_POSIX_PUTMSG stropts.c) zephyr_library_sources_ifdef(CONFIG_POSIX_SIGNAL signal.c ${STRSIGNAL_TABLE_H}) zephyr_library_sources_ifdef(CONFIG_POSIX_SINGLE_PROCESS confstr.c @@ -80,6 +79,7 @@ zephyr_library_sources_ifdef(CONFIG_PTHREAD pthread.c) zephyr_library_sources_ifdef(CONFIG_POSIX_PRIORITY_SCHEDULING sched.c) zephyr_library_sources_ifdef(CONFIG_POSIX_READER_WRITER_LOCKS rwlock.c) zephyr_library_sources_ifdef(CONFIG_POSIX_SEMAPHORES semaphore.c) +zephyr_library_sources_ifdef(CONFIG_XOPEN_STREAMS stropts.c) zephyr_library_sources_ifdef(CONFIG_XSI_SYSTEM_LOGGING syslog.c) zephyr_library_sources_ifdef(CONFIG_GETOPT_LONG diff --git a/lib/posix/options/Kconfig b/lib/posix/options/Kconfig index 3b10f4a6614..43c93305567 100644 --- a/lib/posix/options/Kconfig +++ b/lib/posix/options/Kconfig @@ -43,7 +43,6 @@ rsource "Kconfig.sched" rsource "Kconfig.semaphore" rsource "Kconfig.signal" rsource "Kconfig.spinlock" -rsource "Kconfig.stropts" rsource "Kconfig.sync_io" rsource "Kconfig.timer" rsource "Kconfig.xsi" diff --git a/lib/posix/options/Kconfig.deprecated b/lib/posix/options/Kconfig.deprecated index 524c45edef1..54564d7891f 100644 --- a/lib/posix/options/Kconfig.deprecated +++ b/lib/posix/options/Kconfig.deprecated @@ -129,6 +129,15 @@ config POSIX_MQUEUE Please use CONFIG_POSIX_MESSAGE_PASSING instead. +config POSIX_PUTMSG + bool "Support for putmsg function [DEPRECATED]" + select DEPRECATED + select XOPEN_STREAMS + help + This option is deprecated. + + Please use CONFIG_XOPEN_STREAMS instead. + config POSIX_SYSCONF bool "Support for sysconf() [DEPRECATED]" select DEPRECATED diff --git a/lib/posix/options/Kconfig.stropts b/lib/posix/options/Kconfig.stropts deleted file mode 100644 index 347f0f33c15..00000000000 --- a/lib/posix/options/Kconfig.stropts +++ /dev/null @@ -1,9 +0,0 @@ -# copyright (c) 2024 Abhinav Srivastava -# -# SPDX-License-Identifier: Apache-2.0 - -config POSIX_PUTMSG - bool "Support for putmsg function" - default y if POSIX_API - help - This option provides support for the putmsg function used in message passing. diff --git a/lib/posix/options/Kconfig.xsi b/lib/posix/options/Kconfig.xsi index 6fa10578c21..9de3628a31f 100644 --- a/lib/posix/options/Kconfig.xsi +++ b/lib/posix/options/Kconfig.xsi @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 +menu "X/Open system interfaces" + config XSI_SINGLE_PROCESS bool "X/Open single process" default y if POSIX_API @@ -14,6 +16,16 @@ config XSI_SINGLE_PROCESS For more information, please see https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html +config XOPEN_STREAMS + bool "X/Open streams" + default y if POSIX_API + help + This option provides support for the X/Open Streams interface, including functions such as + fattach(), fdetach(), getmsg(), getpmsg(), putmsg(), and putpmsg(). + + For more information, please see + https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap02.html#tag_02_01_05_09 + config XSI_SYSTEM_LOGGING bool "X/Open system logging" default y if POSIX_API @@ -23,3 +35,5 @@ config XSI_SYSTEM_LOGGING For more information, please see https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html + +endmenu