[PATCH] mqopen: Add support for 'mode' argument in mq_open

Abhinav Srivastava atg271 at gmail.com
Sat Mar 23 21:38:10 UTC 2024


Fixes #1977: Previously, the 'mode' argument in
`mq_open` was accepted but not utilized.
---
 cpukit/posix/src/mqueueopen.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cpukit/posix/src/mqueueopen.c b/cpukit/posix/src/mqueueopen.c
index d01421a0c1..8f8c1c8634 100644
--- a/cpukit/posix/src/mqueueopen.c
+++ b/cpukit/posix/src/mqueueopen.c
@@ -154,6 +154,7 @@ mqd_t mq_open(
   POSIX_Message_queue_Control *the_mq;
   size_t                       name_len;
   Objects_Get_by_name_error    error;
+  mode_t                       mode;
   mqd_t                        status;
 
   _Objects_Allocator_lock();
@@ -185,6 +186,7 @@ mqd_t mq_open(
     va_start( ap, oflag );
     va_arg( ap, mode_t );
     attr = va_arg( ap, const struct mq_attr * );
+    mode = va_arg( ap, mode_t );
     va_end( ap );
 
     if ( attr == NULL ) {
@@ -196,7 +198,7 @@ mqd_t mq_open(
      *  checked. We should go ahead and create a message queue.
      */
 
-    status = _POSIX_Message_queue_Create( name, name_len, oflag, attr );
+    status = _POSIX_Message_queue_Create( name, name_len, oflag, attr, mode );
   } else {
 
     /*
-- 
2.34.1



More information about the devel mailing list