[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] nanosleep
Hi,
On maanantai 21 tammikuu 2013, Peter Slegg wrote:
> I suspect my mintlib might be too old to include nanosleep.
> Is there some way of checking ?
nm /usr/lib/libc.a | grep sleep
The one marked with "T" is the real implementation, others
are references to that.
My MiNTlib from Sparemint (= v0.59.1) doesn't seem to contain
nanosleep(), just usleep().
But why nanosleep() is needed, isn't usleep() microsecond
accuracy enough? [1]
nanosleep() is POSIX 2001, usleep() is BSD function.
[1] On a pre-emptive multitasking OS, process gets
pre-empted at arbitrary times and busy other processes
can lenghten the sleep at max by:
<number of busy processes> * <scheduling slice>
Even with just one, busy process it's milliseconds,
not microseconds.
- Eero