[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] nanosleep
On Mon, 21 Jan 2013 16:44:59 , Eero Tamminen <oak@helsinkinet.fi> wrote:
> 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
>
>
Thanks Eero:
I think I have the same version.
nm: getopt_init.o: no symbols
sleep.o:
00000002 T ___sleep
00000002 W _sleep
usleep.o:
00000000 T _usleep
U _sleep