[systemd-devel] Filter/Parse NETLINK_KOBJECT_UEVENT Messages

Lennart Poettering lennart at poettering.net
Mon Sep 13 11:05:00 UTC 2021


On Mo, 13.09.21 09:29, Ryan McClue (re.mcclue at protonmail.com) wrote:

> Currently, I'm listening to NETLINK_KOBJECT_UEVENT messages with the following code:

Don't. Use the sd-device API from C. Or the old libudev API.

Listening to uevents directly means you either only get the kernel's
own data (i.e. no udev props added by userspace), or you'll have to
reimplement the extended packet format udev uses when propagating the
messages. But the latter is not really considered stable (i mean,
effectively it is, we haven't changed it in years, but it's still
undocumented, and we keep the liberty to change it if we must).

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list