Skip to content

mq_open: missing mq_attr doesn't imply opening an existing queue - #2752

Open
millert wants to merge 1 commit into
nix-rust:masterfrom
millert:mq_open_fix
Open

millert wants to merge 1 commit into
nix-rust:masterfrom
millert:mq_open_fix

Conversation

@millert

@millert millert commented Mar 10, 2026

Copy link
Copy Markdown

It is valid to create a new queue with O_CREAT without specifying an attribute structure, in which case system-specific default attributes will be used. The mode should always be specified and if the mq attributes are missing, a NULL pointer should be used in its place.

Otherwise, stack garbage will be used for the mode and the attributes, which often results in failure with EINVAL (due to mq_msgsize and mq_maxmsg being too large).

It is valid to create a new queue with O_CREAT without specifying an
attribute structure, in which case system-specific default attributes will
be used.  The mode should always be specified and if the mq attributes
are missing, a NULL pointer should be used in its place.

Otherwise, stack garbage will be used for the mode and the attributes,
which often results in failure with EINVAL (due to mq_msgsize and
mq_maxmsg being too large).
@SteveLauC

Copy link
Copy Markdown
Member

I rebased your branch to fix the CI failures.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants