NetBSD-Bugs archive

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

lib/59633: recvmmsg prototype is incompatible with FreeBSD and Linux



>Number:         59633
>Category:       lib
>Synopsis:       recvmmsg prototype is incompatible with FreeBSD and Linux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 05 12:25:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, 8, 7
>Organization:
The NnetBSD Founsignedint
>Environment:
>Description:
Linux/glibc, according to https://www.man7.org/linux/man-pages/man2/recvmmsg.2.html:

       int recvmmsg(int sockfd, struct mmsghdr msgvec[.n], unsigned int n,
                    int flags, struct timespec *timeout);

FreeBSD, according to https://man.freebsd.org/cgi/man.cgi?query=recvmmsg&apropos=0&sektion=2&manpath=FreeBSD+14.3-RELEASE&arch=default&format=html:

       ssize_t
       recvmmsg(int  s,	 struct	 mmsghdr  *  restrict  msgvec,	size_t	 vlen,
	   int flags, const struct timespec * restrict timeout);

Ours, in sys/socket.h:

int	recvmmsg(int, struct mmsghdr *, unsigned int, unsigned int,
    struct timespec *);

Note that:

- FreeBSD and Linux agree flags should be int; we use unsigned int.
- We and Linux agree that timeout should be nonconst; FreeBSD has const.
>How-To-Repeat:
build software that interposes recvmmsg in an LD_PRELOAD library
>Fix:
Yes, please!  Maybe just change unsigned int flags to int flags.



Home | Main Index | Thread Index | Old Index