CVSROOT:        /cvs
Module name:    src
Changes by:     m...@cvs.openbsd.org    2024/08/14 07:54:08

Modified files:
        sys/kern       : kern_sysctl.c 
        sys/sys        : kernel.h 

Log message:
Make sysctl_int() and sysctl_int_lower() mp-safe and unlock KERN_HOSTID.

The only difference between sysctl_int() and sysctl_int_bounded()
is the range check, so sysctl_int() is just sysctl_int_bounded(...,
INT_MIN, INT_MAX). sysctl_int() is not the fast path, so this useless
check is not significant.

Mp-safe sysctl_int() is meaningless for sysctl_int_lower(), so rework it
in the sysctl_int_bounded() style. This time all affected paths are
kernel locked, but this doesn't make sysctl_int_lower() worse.

Change `hostid' type to the type of int. It only stored but never used
within kernel, userland accesses it through sysctl_int(). Nothing
changes, but variable becomes consistent with sysctl_int().

ok bluhm

Reply via email to