tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Why do sendmmsg and recvmmsg take unsigned int flags?



Saw this on the musl mailing list.

We also seem to have `unsigned int flags` since day one.  Note that
`flags` is the same as in send/recv &co, where it's `int flags`.

Should we fix this?

-uwe
--- Begin Message ---
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

Attachment: signature.asc
Description: PGP signature


--- End Message ---


Home | Main Index | Thread Index | Old Index