Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260611211020.GJ27423@brightrain.aerifal.cx>
Date: Thu, 11 Jun 2026 17:10:20 -0400
From: Rich Felker <dalias@...c.org>
To: Alyssa Ross <hi@...ssa.is>
Cc: musl@...ts.openwall.com
Subject: Re: Why do sendmmsg and recvmmsg take unsigned int flags?

On Thu, Jun 11, 2026 at 06:30:18PM +0200, Alyssa Ross wrote:
> sendmmsg and recvmmsg are declared in musl as follows:
> 
> int sendmmsg (int, struct mmsghdr *, unsigned int, unsigned int);
> int recvmmsg (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *);
> 
> Glibc declares the fourth parameter (flags) as int, as does FreeBSD.
> The syscall definition in Linux is unsigned int, but I'd have expected
> compatibility with other implementations to outweigh matching the
> syscall.
> 
> Was this an intentional decision?  Should it stay this way?
> 
> (I encountered this due to a test that wraps libc's sendmmsg[1])
> 
> [1]: https://gitlab.freedesktop.org/libnice/libnice/-/blob/master/tests/instrument-send.c#L193-218

I'm pretty sure this was unintentional, perhaps just matching
documentation of the raw syscall. We should look at whether it makes
sense to align it with other implementations.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.