HomeFreeBSD

sysctlbyname(): restore access to user variables

Description

sysctlbyname(): restore access to user variables

The optimization of sysctlbyname() in commit d05b53e0baee7 had the
side-effect of not going through the fix-up for the user.* variables
in the previously called sysctl() function.

This lead to 0 or an empty strings being returned by sysctlbyname()
for all user.* variables.

An alternate implementation would store the user variables in the
kernel during system start-up. That would allow to remove the fix-up
code in the C library that is currently required to provide the actual
values.

This update restores the previous code path for the user.* variables
and keeps the performance optimization intact for all other variables.

Approved by: mjg
Reviewed by: kaktus
Differential Revision: https://reviews.freebsd.org/D34171

Details

Provenance
seAuthored on Feb 9 2022, 9:56 PM
Reviewer
kaktus
Differential Revision
D34171: Restore access to "user.*" variables in sysctlbyname()
Parents
rG489d7a8528ca: Enable -Wdate-time warning
Branches
Unknown
Tags
Unknown