Re: usleep: Document Cygwin bug

2024-06-08 Thread Bruno Haible
> In a CI run of libunistring (on GitHub), I see a test failure: > > ../../tests/test-usleep.c:35: assertion 'start < time (NULL)' failed > FAIL test-usleep.exe (exit status: 134) I'm seeing this test failure again. It's time to disable the test on Cygwin. 2024-06-08 Bruno Haible

Re: usleep

2009-11-20 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 11/18/2009 10:16 PM: > At any rate, here's what I'm now testing, it has passed on cygwin, 64-bit > Linux, and Solaris. The nanosleep code is a complete rewrite, and is > actually lighter-weight (no need to use clock_gettime)

Re: usleep

2009-11-18 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 11/18/2009 5:56 PM: > Yep. I'll fix it in my respin. Besides, I found out that rpl_nanosleep > needs the same bug fix, and not only that, but it has a logic bug - it > ignores EINTR, forcing the sleep to last until a fatal

Re: usleep

2009-11-18 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Ludovic Courtès on 11/18/2009 4:35 PM: >> +{ >> + seconds -= limit; >> + unsigned int result = sleep (limit); > > This declaration-after-statement is a C99 thing. Isn’t it something > usually avoided in Gnulib? Yep. I'll

Re: usleep

2009-11-18 Thread Ludovic Courtès
Hi, Eric Blake writes: > +unsigned int > +rpl_sleep (unsigned int seconds) > +{ > + const unsigned int limit = 49 * 24 * 60 * 60; > + while (limit < seconds) > +{ > + seconds -= limit; > + unsigned int result = sleep (limit); This declaration-after-statement is a C99 thing. Isn

Re: usleep (was: pending patches?)

2009-11-18 Thread Eric Blake
Eric Blake byu.net> writes: > I'm pushing this. Most systems these days still support usleep, even > though POSIX no longer requires it; even mingw has it; so the few > platforms where this implementation rounds up to the ceiling of the next > second should be rare (still correct behavior, just