Messages in this thread | | | Date | Sun, 21 Mar 2004 10:58:20 +1100 | From | Peter Williams <> | Subject | Re: finding out the value of HZ from userspace |
| |
Albert Cahalan wrote: > On Sat, 2004-03-20 at 04:56, Arjan van de Ven wrote: > >>On Tue, Mar 16, 2004 at 11:14:59AM -0500, Albert Cahalan wrote: >> >>>>there is one. Nothing uses it >>>>(sysconf() provides this info) >>> >>>If you have a recent glibc on a recent kernel, it might. >>>You could also get a -1 or a supposed ABI value that >>>has nothing to do with the kernel currently running. >>>The most reliable way is to first look around on the >>>stack in search of ELF notes, and then fall back to >>>some horribly gross hacks as needed. >> >>eh sysconf() is the nice way to get to the ELF notes >>instead of having to grovel yourself. > > > Unless there is some hidden feature that lets > me specify the ELF note number directly, no way. > > The sysconf(_SC_CLK_TCK) call does not return an > error code when used on a 2.2.xx i386 kernel. > You get an arbitrary value that fails for ARM, > Alpha, and any system with modified HZ.
As Linux is supposed to be POSIX compliant this is a bug and should be fixed.
Peter -- Dr Peter Williams, Chief Scientist peterw@aurema.com Aurema Pty Limited Tel:+61 2 9698 2322 PO Box 305, Strawberry Hills NSW 2012, Australia Fax:+61 2 9699 9174 79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |