Skip to content

Allow setting RLIMIT_MSGQUEUE - #16013

Merged
copybara-service[bot] merged 2 commits into
masterfrom
test/cl1002551540
Oct 19, 2026
Merged

copybara-service[bot] merged 2 commits into
masterfrom
test/cl1002551540

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Allow setting RLIMIT_MSGQUEUE

Fixes #15944

setrlimit(RLIMIT_MSGQUEUE, ...) returns EPERM even when the new value equals the current one, because limits.MessageQueueBytes is missing from setableLimits in sys_rlimit.go. This adds it, so the limit is accepted and stored but not enforced, the same as Core, ProcessCount and RealTimePriority.

Testing: new RlimitTest.SetRlimitMsgqueue in rlimits.cc reads RLIMIT_MSGQUEUE, sets the same value back, then lowers the soft limit by 1 and reads it back. It fails with EPERM without the change and passes with it under //test/syscalls:rlimits_test_runsc_ptrace.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15948 from adi-IL:fix-rlimit-msgqueue-setable c4fc872

prlimit64 rejected RLIMIT_MSGQUEUE with EPERM because it was missing
from setableLimits, even when setting the current value. Accept it
without enforcing it, like RLIMIT_CORE and RLIMIT_NPROC.

Fixes #15944
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Oct 19, 2026
@copybara-service
copybara-service Bot merged commit 33b4e65 into master Oct 19, 2026
2 of 4 checks passed
@copybara-service
copybara-service Bot deleted the test/cl1002551540 branch October 19, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setrlimit(RLIMIT_MSGQUEUE) fails with EPERM, even to its current value

2 participants