A deep dive into how Linux hardware hotplug events work at the kernel and userspace level, without relying on libusb or libudev. Covers the two hotplug backends in libusb (netlink and udev), explains the netlink socket API for receiving kernel uevent messages, and documents the undocumented binary udev packet format including its header structure, MurmurHash2-based subsystem/devtype hashes, and 64-bit Bloom filter for BPF-based event filtering. Includes complete working C code to listen to both kernel and udev multicast groups, plus security considerations around credential passing via SO_PASSCRED.
Table of contents
udevnetlinkExample codeListening to kernel eventsListening to udev rebroadcasted eventsudev packet format"Security Considerations" (RFC 6919)Sort: