Edit

IABSD.fr/src/lib/libc/gmon

Branch :

  • Show log

    Commit

  • Author : cheloha
    Date : 2022-07-26 04:07:13
    Hash : 39152b4f
    Message : moncontrol(3): remove hertz() fallback function In the moncontrol(3) code in libc there is a fallback function, hertz(). The idea is, if getting kern.clockrate from sysctl(2) fails, we fall back to deriving the value of hz(9) using setitimer(2)'s rounding behavior. This is extremely clever, but it actually sucks. Calling setitimer(2) quietly cancels any extant ITIMER_REAL timer, so moncontrol(3) cannot be safely used alongside setitimer(2). This fact is not documented. kern.clockrate is not blocked by pledge(2), so outside of stack corruption (which we can't do anything about anyway) I don't see a way for the sysctl(2) call to ever fail on OpenBSD. So hertz() is also pointless. Hence this patch: get rid of hertz(). Thread: https://marc.info/?l=openbsd-tech&m=163881542813633&w=2 ok guenther@