NetBSD Problem Report #60211
From thierry@vminetbsd.localdomain Sun Apr 26 13:11:41 2026
Return-Path: <thierry@vminetbsd.localdomain>
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) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "R12" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 26CD11A923C
for <gnats-bugs@gnats.NetBSD.org>; Sun, 26 Apr 2026 13:11:41 +0000 (UTC)
Message-Id: <20260426102918.DB9C11C2BB@vminetbsd.localdomain>
Date: Sun, 26 Apr 2026 12:29:18 +0200 (CEST)
From: thierry@lelegard.fr
Reply-To: thierry@lelegard.fr
To: gnats-bugs@NetBSD.org
Subject: Inconsistent definitions in kqueue: missing EVFILT_USER, incorrect udata type
X-Send-Pr-Version: 3.95
X-From4GNATS: "thierry@lelegard.fr via gnats" <gnats-admin@NetBSD.org>
>Number: 60211
>Category: lib
>Synopsis: Inconsistent definitions in kqueue: missing EVFILT_USER, incorrect udata type
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Apr 26 13:15:00 +0000 2026
>Last-Modified: Sun Apr 26 14:05:01 +0000 2026
>Originator: Thierry Lelegard
>Release: NetBSD 10.1
>Organization:
TSDuck open source project (tsduck.io)
>Environment:
System: NetBSD vminetbsd 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
The definition of kqueue(2) and its man page are inconsistent with the
documentation on netbsd.org, as well as all other implementations of
kqueue on FreeBSD, OpenBSD, DragonflyBSD and macOS. As a consequence,
some applications which use kqueue cannot be ported to NetBSD.
The documentation on netbsd.org is compatible with all other BSD systems.
However, the reality on a NetBSD 10.1 system is not.
References on netbsd.org:
- https://man.netbsd.org/kqueue.2
- https://wiki.netbsd.org/tutorials/kqueue_tutorial/
Some identified inconsistencies:
- The field udata in struct kevent is intptr_t instead of void*
- The filter EVFILT_USER is missing.
>How-To-Repeat:
cat /usr/include/sys/event.h
man kqueue
>Fix:
No general fix.
The incorrect type for the udata field can be muted using a type cast.
However, the absence of EVFILT_USER prevents the application from working.
>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: lib/60211: Inconsistent definitions in kqueue: missing
EVFILT_USER, incorrect udata type
Date: Sun, 26 Apr 2026 16:03:37 +0200
On Sun, Apr 26, 2026 at 01:15:00PM +0000, thierry@lelegard.fr via gnats wrote:
> The documentation on netbsd.org is compatible with all other BSD systems.
> However, the reality on a NetBSD 10.1 system is not.
>
> References on netbsd.org:
> - https://man.netbsd.org/kqueue.2
> - https://wiki.netbsd.org/tutorials/kqueue_tutorial/
You need to check the netbsd-10 man pages if you compare against 10.1.
For current (so matching your man.netbsd.org quey), you will find:
https://nxr.netbsd.org/xref/src/sys/sys/event.h#47
https://nxr.netbsd.org/xref/src/sys/sys/event.h#66
Martin
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.