#1977 new defect

mq_open lacks support of "mode" argument

Reported by: Ralf Corsepius Owned by: Joel Sherrill
Priority: low Milestone: Indefinite
Component: score Version:
Severity: normal Keywords: POSIX-Compliance
Cc: Blocked By:
Blocking:

Description (last modified by Sebastian Huber)

mq_open in cpukit/posix/src/mqueueopen.c lacks support of mq_open's "mode" argument:

mqd_t mq_open(const char *name, int oflag);
mqd_t mq_open(const char *name, int oflag, mode_t mode,

struct mq_attr *attr);

The RTEMS implementation only pretends to be supporting it,
which also reflects in a GCC warning:
cpukit/posix/src/mqueueopen.c:54:35: warning: variable 'mode' set but not used

Change History (8)

comment:1 Changed on 12/01/11 at 02:30:15 by Ralf Corsepius

mq_open in cpukit/posix/src/mqueueopen.c lacks support of mq_open's "mode" argument:

mqd_t mq_open(const char *name, int oflag);
mqd_t mq_open(const char *name, int oflag, mode_t mode,

struct mq_attr *attr);

The RTEMS implementation only pretends to be supporting it,
which also reflects in a GCC warning:
cpukit/posix/src/mqueueopen.c:54:35: warning: variable 'mode' set but not used

comment:2 Changed on 12/01/11 at 02:35:09 by Ralf Corsepius

see_also: https://www.rtems.org/bugzilla/show_bug.cgi?id=1978

comment:3 Changed on 11/24/14 at 18:58:28 by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

comment:4 Changed on 12/18/14 at 11:05:36 by Sebastian Huber

Description: modified (diff)
Milestone: 4.115.0
Priority: normallow

comment:5 Changed on 04/03/17 at 23:19:39 by Joel Sherrill

Keywords: POSIX-Compliance added

Evaluate the meaning of mode on this call and deal with this ticket.

comment:6 Changed on 08/14/17 at 00:33:42 by Chris Johns

Milestone: 5.0Indefinite
Version: 4.11

comment:7 Changed on 03/22/24 at 18:56:20 by Abhinav (August) Radjoe

Would we want to implement other methods in such a way that mod is used or do we remove modefor now?

Thx

comment:8 Changed on 03/22/24 at 19:21:02 by Joel Sherrill

The parameter should not be removed. It needs to be fetched into a variable like attr around line 186 of mqueueopen.c. Currently it is "skipped" in the variable argument and not saved into a variable. It needs to be fetched and honored somehow when oflag includes O_CREAT. See https://pubs.opengroup.org/onlinepubs/009696699/functions/mq_open.html

Note: See TracTickets for help on using tickets.