NetBSD Problem Report #59633
From www@netbsd.org Fri Sep 5 12:22:40 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 2F4351A923A
for <gnats-bugs@gnats.NetBSD.org>; Fri, 5 Sep 2025 12:22:40 +0000 (UTC)
Message-Id: <20250905122238.DDAAB1A923E@mollari.NetBSD.org>
Date: Fri, 5 Sep 2025 12:22:38 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: recvmmsg prototype is incompatible with FreeBSD and Linux
X-Send-Pr-Version: www-1.0
>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
>Last-Modified: Fri Sep 05 13:20:01 +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.
>Audit-Trail:
From: Jason Thorpe <thorpej@me.com>
To: gnats-bugs@netbsd.org
Cc: lib-bug-people@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: lib/59633: recvmmsg prototype is incompatible with FreeBSD and
Linux
Date: Fri, 5 Sep 2025 06:17:10 -0700
> On Sep 5, 2025, at 5:25=E2=80=AFAM, campbell+netbsd@mumble.net wrote:
> Linux/glibc, according to =
https://www.man7.org/linux/man-pages/man2/recvmmsg.2.html:
>=20
> int recvmmsg(int sockfd, struct mmsghdr msgvec[.n], unsigned int =
n,
> int flags, struct timespec *timeout);
Since it=E2=80=99s an originated-by-Linux extension, shouldn=E2=80=99t =
we match Linux?
-- thorpej
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.