Fix Hertz calculation for FreeBSD
FreeBSD has no good way of finding the Hertz value. ELF notes don't work, you can't find it in a function and even asm/params.h does not have it. Lucky for us, it is always 100. Based upon Debian patch patch sysinfo_kfreebsd_hertz by Petr Salinger Bug-Debian: http://bugs.debian.org/460331 Caution, 460331 has lots of overlapping bugs all around the Hertz problem across many arches.
This commit is contained in:
parent
aae3d318d4
commit
a5750100a0
@ -260,6 +260,14 @@ static void init_libproc(void){
|
||||
fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr);
|
||||
}
|
||||
#endif /* __linux __ */
|
||||
#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
|
||||
/* On FreeBSD the Hertz hack is unrelaible, there is no ELF note and
|
||||
* Hertz isn't defined in asm/params.h
|
||||
* See Debian Bug #460331
|
||||
*/
|
||||
Hertz = 100;
|
||||
return;
|
||||
#endif /* __FreeBSD__ */
|
||||
old_Hertz_hack();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user