diff --git a/doc/services/portability/posix/aep/index.rst b/doc/services/portability/posix/aep/index.rst index b720520ebd9..ad02c3e4cb8 100644 --- a/doc/services/portability/posix/aep/index.rst +++ b/doc/services/portability/posix/aep/index.rst @@ -109,7 +109,7 @@ The *Realtime Controller System Profile* (PSE52) includes all features from PSE5 :header: Symbol, Support, Remarks :widths: 50, 10, 50 - :ref:`_POSIX_MESSAGE_PASSING `, 200809L, :kconfig:option:`CONFIG_POSIX_MQUEUE` + :ref:`_POSIX_MESSAGE_PASSING `, 200809L, :kconfig:option:`CONFIG_POSIX_MESSAGE_PASSING` _POSIX_TRACE, -1, _POSIX_TRACE_EVENT_FILTER, -1, _POSIX_TRACE_LOG, -1, diff --git a/doc/services/portability/posix/conformance/index.rst b/doc/services/portability/posix/conformance/index.rst index e82565ae83c..b4baa41262d 100644 --- a/doc/services/portability/posix/conformance/index.rst +++ b/doc/services/portability/posix/conformance/index.rst @@ -86,7 +86,7 @@ POSIX System Interfaces _POSIX_IPV6, 200809L, :kconfig:option:`CONFIG_NET_IPV6` _POSIX_MEMLOCK, -1, _POSIX_MEMLOCK_RANGE, -1, - :ref:`_POSIX_MESSAGE_PASSING`, 200809L, :kconfig:option:`CONFIG_POSIX_MQUEUE` + :ref:`_POSIX_MESSAGE_PASSING`, 200809L, :kconfig:option:`CONFIG_POSIX_MESSAGE_PASSING` :ref:`_POSIX_MONOTONIC_CLOCK`, 200809L, :kconfig:option:`CONFIG_POSIX_MONOTONIC_CLOCK` _POSIX_PRIORITIZED_IO, -1, :ref:`_POSIX_PRIORITY_SCHEDULING`, 200809L, :kconfig:option:`CONFIG_POSIX_PRIORITY_SCHEDULING` diff --git a/doc/services/portability/posix/kconfig/index.rst b/doc/services/portability/posix/kconfig/index.rst index 8adc0a4058e..51dc795115e 100644 --- a/doc/services/portability/posix/kconfig/index.rst +++ b/doc/services/portability/posix/kconfig/index.rst @@ -17,7 +17,7 @@ implementation of the POSIX API. * :kconfig:option:`CONFIG_MAX_PTHREAD_MUTEX_COUNT` * :kconfig:option:`CONFIG_MAX_PTHREAD_SPINLOCK_COUNT` * :kconfig:option:`CONFIG_MQUEUE_NAMELEN_MAX` -* :kconfig:option:`CONFIG_MSG_COUNT_MAX` +* :kconfig:option:`CONFIG_POSIX_MQ_OPEN_MAX` * :kconfig:option:`CONFIG_MSG_SIZE_MAX` * :kconfig:option:`CONFIG_NET_SOCKETPAIR` * :kconfig:option:`CONFIG_NET_SOCKETS` @@ -26,7 +26,6 @@ implementation of the POSIX API. * :kconfig:option:`CONFIG_POSIX_FS` * :kconfig:option:`CONFIG_ZVFS_OPEN_MAX` * :kconfig:option:`CONFIG_POSIX_OPEN_MAX` -* :kconfig:option:`CONFIG_POSIX_MQUEUE` * :kconfig:option:`CONFIG_POSIX_RTSIG_MAX` * :kconfig:option:`CONFIG_POSIX_SIGNAL` * :kconfig:option:`CONFIG_POSIX_SIGNAL_STRING_DESC` diff --git a/include/zephyr/posix/mqueue.h b/include/zephyr/posix/mqueue.h index dbaa6d42a53..aac03426da4 100644 --- a/include/zephyr/posix/mqueue.h +++ b/include/zephyr/posix/mqueue.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_POSIX_MQUEUE_H_ -#define ZEPHYR_INCLUDE_POSIX_MQUEUE_H_ +#ifndef ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_ +#define ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_ #include #include @@ -47,4 +47,4 @@ int mq_notify(mqd_t mqdes, const struct sigevent *notification); } #endif -#endif /* ZEPHYR_INCLUDE_POSIX_MQUEUE_H_ */ +#endif /* ZEPHYR_INCLUDE_POSIX_MESSAGE_PASSING_H_ */ diff --git a/include/zephyr/posix/posix_features.h b/include/zephyr/posix/posix_features.h index 75bb0c0efeb..9b53a4ba646 100644 --- a/include/zephyr/posix/posix_features.h +++ b/include/zephyr/posix/posix_features.h @@ -53,7 +53,7 @@ /* #define _POSIX_MEMLOCK_RANGE (-1L) */ /* #define _POSIX_MEMORY_PROTECTION (-1L) */ -#ifdef CONFIG_POSIX_MQUEUE +#ifdef CONFIG_POSIX_MESSAGE_PASSING #define _POSIX_MESSAGE_PASSING _POSIX_VERSION #endif @@ -207,7 +207,7 @@ #define _POSIX_MAX_CANON (255) #define _POSIX_MAX_INPUT (255) #define _POSIX_MQ_OPEN_MAX \ - COND_CODE_1(CONFIG_POSIX_MQUEUE, (CONFIG_MSG_COUNT_MAX), (0)) + COND_CODE_1(CONFIG_POSIX_MESSAGE_PASSING, (CONFIG_POSIX_MQ_OPEN_MAX), (0)) #define _POSIX_MQ_PRIO_MAX (32) #define _POSIX_NAME_MAX (14) #define _POSIX_NGROUPS_MAX (8) diff --git a/include/zephyr/posix/sys/sysconf.h b/include/zephyr/posix/sys/sysconf.h index dcd4eb27922..dfcebd28cc2 100644 --- a/include/zephyr/posix/sys/sysconf.h +++ b/include/zephyr/posix/sys/sysconf.h @@ -158,7 +158,7 @@ enum { #define __z_posix_sysconf_SC_MEMLOCK_RANGE (-1L) #define __z_posix_sysconf_SC_MEMORY_PROTECTION (-1L) #define __z_posix_sysconf_SC_MESSAGE_PASSING \ - COND_CODE_1(CONFIG_POSIX_MQUEUE, (_POSIX_MESSAGE_PASSING), (-1L)) + COND_CODE_1(CONFIG_POSIX_MESSAGE_PASSING, (_POSIX_MESSAGE_PASSING), (-1L)) #define __z_posix_sysconf_SC_MONOTONIC_CLOCK \ COND_CODE_1(CONFIG_POSIX_MONOTONIC_CLOCK, (_POSIX_MONOTONIC_CLOCK), (-1L)) #define __z_posix_sysconf_SC_PRIORITIZED_IO (-1L) diff --git a/lib/posix/options/CMakeLists.txt b/lib/posix/options/CMakeLists.txt index 02c8c30dd74..a6ce721b4ce 100644 --- a/lib/posix/options/CMakeLists.txt +++ b/lib/posix/options/CMakeLists.txt @@ -25,7 +25,7 @@ if(CONFIG_POSIX_SIGNAL) endif() if(CONFIG_POSIX_API OR CONFIG_PTHREAD_IPC OR CONFIG_POSIX_TIMERS OR - CONFIG_POSIX_MQUEUE OR CONFIG_POSIX_FS OR CONFIG_EVENTFD OR CONFIG_GETOPT OR + CONFIG_POSIX_MESSAGE_PASSING OR CONFIG_POSIX_FS OR CONFIG_EVENTFD OR CONFIG_GETOPT OR CONFIG_POSIX_SINGLE_PROCESS) # This is a temporary workaround so that Newlib declares the appropriate # types for us. POSIX features to be formalized as part of #51211 @@ -49,7 +49,7 @@ zephyr_library_sources_ifdef(CONFIG_POSIX_FD_MGMT fd_mgmt.c ) zephyr_library_sources_ifdef(CONFIG_POSIX_FS fs.c) -zephyr_library_sources_ifdef(CONFIG_POSIX_MQUEUE mqueue.c) +zephyr_library_sources_ifdef(CONFIG_POSIX_MESSAGE_PASSING mqueue.c) zephyr_library_sources_ifdef(CONFIG_POSIX_MULTI_PROCESS sleep.c ) diff --git a/lib/posix/options/Kconfig.deprecated b/lib/posix/options/Kconfig.deprecated index 203b8463bd7..b2ed5e60028 100644 --- a/lib/posix/options/Kconfig.deprecated +++ b/lib/posix/options/Kconfig.deprecated @@ -15,6 +15,15 @@ config MAX_TIMER_COUNT Please use CONFIG_POSIX_TIMER_MAX instead. +config MSG_COUNT_MAX + int "Maximum number of messages in a POSIX message queue [DEPRECATED]" + default POSIX_MQ_OPEN_MAX if POSIX_MESSAGE_PASSING + default 0 + help + This option is deprecated. + + Please use CONFIG_POSIX_MQ_OPEN_MAX instead. + config POSIX_CLOCK bool "clock and sleep APIs [DEPRECATED]" select DEPRECATED @@ -75,6 +84,15 @@ config POSIX_MAX_OPEN_FILES See also CONFIG_ZVFS_OPEN_MAX. +config POSIX_MQUEUE + bool "Message queue support [DEPRECATED]" + select DEPRECATED + select POSIX_MESSAGE_PASSING + help + This option is deprecated. + + Please use CONFIG_POSIX_MESSAGE_PASSING instead. + config POSIX_SYSCONF bool "Support for sysconf() [DEPRECATED]" select DEPRECATED diff --git a/lib/posix/options/Kconfig.mqueue b/lib/posix/options/Kconfig.mqueue index 3688455d781..607885b21cf 100644 --- a/lib/posix/options/Kconfig.mqueue +++ b/lib/posix/options/Kconfig.mqueue @@ -2,33 +2,39 @@ # # SPDX-License-Identifier: Apache-2.0 -menuconfig POSIX_MQUEUE - bool "Message queue support" +menuconfig POSIX_MESSAGE_PASSING + bool "POSIX message queue support" default y if POSIX_API help This enabled POSIX message queue related APIs. -if POSIX_MQUEUE +if POSIX_MESSAGE_PASSING -config MSG_COUNT_MAX - int "Maximum number of messages in message queue" +config POSIX_MQ_OPEN_MAX + int "Maximum number of messages in a POSIX message queue" default 16 help Mention maximum number of messages in message queue in POSIX compliant application. +config POSIX_MQ_PRIO_MAX + int "Maximum number of POSIX message priorities" + default 32 + help + Maximum number of message priorities supported by the implementation. + config MSG_SIZE_MAX - int "Maximum size of a message" + int "Maximum size of a POSIX message" default 16 help Mention maximum size of message in bytes. config MQUEUE_NAMELEN_MAX - int "Maximum size of a name length" + int "Maximum POSIX message queue name size" default 16 range 2 255 help - Mention length of message queue name in number of characters. + Mention size of message queue name in number of characters. config HEAP_MEM_POOL_ADD_SIZE_MQUEUE def_int 1024 diff --git a/lib/posix/options/mqueue.c b/lib/posix/options/mqueue.c index ca8e5474488..ce77283e637 100644 --- a/lib/posix/options/mqueue.c +++ b/lib/posix/options/mqueue.c @@ -118,7 +118,7 @@ mqd_t mq_open(const char *name, int oflags, ...) /* Check for message quantity and size in message queue */ if (attrs->mq_msgsize > CONFIG_MSG_SIZE_MAX && - attrs->mq_maxmsg > CONFIG_MSG_COUNT_MAX) { + attrs->mq_maxmsg > CONFIG_POSIX_MQ_OPEN_MAX) { goto free_mq_desc; } diff --git a/tests/posix/common/prj.conf b/tests/posix/common/prj.conf index bc92bed8fbf..5c5613d0e68 100644 --- a/tests/posix/common/prj.conf +++ b/tests/posix/common/prj.conf @@ -3,7 +3,7 @@ CONFIG_POSIX_API=y CONFIG_MAX_PTHREAD_COUNT=6 CONFIG_ZTEST=y CONFIG_SEM_VALUE_MAX=32767 -CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MESSAGE_PASSING=y CONFIG_POSIX_PRIORITY_SCHEDULING=y CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_THREAD_NAME=y diff --git a/tests/posix/headers/prj.conf b/tests/posix/headers/prj.conf index 7161e4b3115..6dc46dc7b4f 100644 --- a/tests/posix/headers/prj.conf +++ b/tests/posix/headers/prj.conf @@ -17,6 +17,6 @@ CONFIG_NET_SOCKETPAIR=y CONFIG_PTHREAD_IPC=y CONFIG_POSIX_FS=y CONFIG_POSIX_TIMERS=y -CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MESSAGE_PASSING=y CONFIG_EVENTFD=y CONFIG_GETOPT=y