Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSD platforms: Reject negative and zero KERN_FSCALE factors #1275

Merged
merged 2 commits into from
Aug 30, 2023

Commits on Aug 30, 2023

  1. Configuration menu
    Copy the full SHA
    81dcb24 View commit details
    Browse the repository at this point in the history
  2. BSD platforms: Reject negative and zero KERN_FSCALE factors

    The "fscale" value, retrieved by sysctl() in BSD platforms, is used for
    computing CPU percentages of the processes. To prevent a division by
    zero, we should reject a zero "fscale" value. (A negative "fscale"
    value will not make sense either.)
    
    For DragonFlyBSD and FreeBSD, this would fall back to the hard-coded
    default scale.
    For NetBSD and OpenBSD, there is no hard-coded default value, so the
    zero or negative "fscale" is now a fatal error.
    
    Signed-off-by: Kang-Che Sung <[email protected]>
    Explorer09 committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    81d19a7 View commit details
    Browse the repository at this point in the history