maintainer-feedback requested: [Bug 296887] devel/libudev-devd: udev-monitor: make the monitor fd non-blocking

[email protected] Sat, 18 Jul 2026 19:19:08 +0000
Newsgroups gmane.os.freebsd.devel.x11
Message-ID <[email protected]/bugzilla/>
Bugzilla Automation <[email protected]> has asked freebsd-x11 (Nobody)
<[email protected]> for maintainer-feedback:
Bug 296887: devel/libudev-devd: udev-monitor: make the monitor fd non-blocking
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296887



--- Description ---
systemd's libudev documents that the monitor socket is non-blocking by default:

https://github.com/systemd/systemd/blob/v261/src/libudev/libudev-monitor.c#L228
-L231

It also creates the monitor socket with SOCK_NONBLOCK:

https://github.com/systemd/systemd/blob/v261/src/libsystemd/sd-device/device-mo
nitor.c#L179-L183

libudev-devd currently uses a blocking pipe. Once all pending events have been
consumed, another call to udev_monitor_receive_device() blocks instead of
returning NULL with EAGAIN.

This was observed in KWin, where display hotplug handling stalled after
disconnecting and reconnecting an external display in a KDE/Wayland session.

Set O_NONBLOCK on the read end returned by udev_monitor_get_fd(). Keep the
internal write end blocking to preserve the current producer and backpressure
behavior.