[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] usleep MiNTlib function



Hi all!

MiNTlib function usleep( )  (/mintlib/posix/usleep.c) doesn't behave as expected under TOS.

Function tries to use Fselect when time  > 1000 microseconds, and _clock( ) when time is <1000 microseconds or when we are in a system without Fselect, as in TOS we don't have Fselect we get an ENOSYS(-32) error.
Later in a "if" statement  is compared the value returned by Fselect (under TOS value = -32) with "-ENOSYS" that will be 32 (-(-32) = 32), so the _clock function won't be called under TOS.

I think we should remove two minus signs, one in:

int r = -ENOSYS   (line 23)

and other one in:

if (r == -ENOSYS)  (line 28)

I tested it and it works fine with TOS.

David Galvez