bug-gnulib
[Top][All Lists]
Advanced

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

Bug in nanosleep() implementation for Unix platforms lacking same


From: Daniel Richard G.
Subject: Bug in nanosleep() implementation for Unix platforms lacking same
Date: Thu, 17 Sep 2015 23:27:19 -0400

Hello list,

Lately I am testing and enhancing Gnulib on a relatively exotic
POSIX platform.

This platform lacks nanosleep(), and so uses the implementation
starting at lib/nanosleep.c:227 (Git master). Investigating a failure
in test-nanosleep, I found that the following assertion...

    ASSERT (nanosleep (&ts, &ts) == -1);

...tripped because the function returned 0, despite having been
interrupted by a SIGALRM. This appeared to occur not because of a
platform issue, but due to the implementation itself. I was able to
reproduce this failure on Linux after forcing Gnulib to use that same
implementation.

In nanosleep.c, the sighandler() function is never called (is the
program supposed to receive SIGCONT when some other signal interrupts
select()?), and even if it did, the nanosleep() implementation would
then return 1 instead of the correct value of -1.


Please Cc: any replies to me, as I am not subscribed to this list.


--Daniel


-- 
Daniel Richard G. || address@hidden
My ASCII-art .sig got a bad case of Times New Roman.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]