Undocumented option for powerd (from powerd.c source)?

Manpage for powerd says:

-s source Enforces method for AC line state refresh; by default, it
is chosen automatically. The set of valid methods is
sysctl, devd and apm (i386 only).

But the source code (powerd.c) says:

Code:
typedef enum {
    ac_none,
    ac_sysctl,
    ac_acpi_devd,
#ifdef USE_APM
    ac_apm,
#endif
    ac_acpi_netlink,
}

What the heck is ac_acpi_netlink? Why does powerd require netlink at all? Why is acpi_netlink "method" undocumented in the manual page?
 
The new code uses nlsysevent (Netlink System Event). This allows powerd to subscribe to system events directly from the kernel, bypassing the userspace devd daemon entirely for event delivery. This reduces latency and dependency chains. If the devd daemon crashes or hangs, powerd can still receive power events via Netlink.

FreeBSD has been actively integrating Netlink (a standard Linux kernel interface defined in RFC 3549) to replace custom BSD ioctls and routing sockets. While initially added for network routing, FreeBSD 15 is expanding Netlink to generic system events (nlsysevent). This makes the code more robust and aligns FreeBSD with modern OS architectural patterns where event delivery is handled via structured sockets rather than text pipes.

The code explicitly treats Netlink as the preferred method, falling back to older methods only if Netlink fails.

The FreeBSD 15.0 manpage for powerd should say that unless specified otherwise source will be Netlink.
 
Back
Top