Re: [PATCH] [PATCH V5] mqueue: introduce new do_mq_timedreceive2() [ mq_peek syscall] for non-destructive receive and inspection,fix minor issue,prepared doc.
From: Randy Dunlap
Date: Fri Mar 06 2026 - 16:56:30 EST
Warning: trailing whitespace in line 1763 of ipc/mqueue.c
On 3/5/26 11:50 PM, Mathura_Kumar wrote:
> +2) Motivation
> +-------------
> +
> +The original mq_timedreceive() interface exhausts all usable syscall
> +argument slots with mqdes, msg_ptr, msg_len, msg_prio, and abs_timeout.
> +Adding new behavior such as peek-without-consume or indexed message
> +access would require either a new syscall with a completely different
> +signature, or overloading existing arguments in ways that harm clarity
> +and correctness.
> +
> +By consolidating the message buffer parameters into a struct, this
> +syscall recovers argument slots for:
End the line above with "for::" so that the following lines don't run
together.
> +
> + flags - controls peek vs consume and other future behavior
> + index - selects a specific message position in the priority queue
> +
> +This design follows the precedent of other Linux syscalls that use
> +struct arguments to allow forward-compatible extensibility, such as
> +clone3() and openat2().
How much AI use is present in this patch?
thanks.
--
~Randy