[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OpenBSD 4.7 vs nanosleep
From: |
Jim Meyering |
Subject: |
OpenBSD 4.7 vs nanosleep |
Date: |
Fri, 08 Oct 2010 19:52:06 +0200 |
FYI,
In this part of test-nanosleep.c, on OpenBSD 4.7,
nanosleep ends up sleeping the 10 seconds before returning 0.
Wrong on both counts. It shouldn't sleep at all, and it should
have returned -1.
int
main (void)
{
struct timespec ts;
ts.tv_sec = 10;
ts.tv_nsec = -1;
errno = 0;
ASSERT (nanosleep (&ts, NULL) == -1);
ASSERT (errno == EINVAL);
The original test had tv-sec = 1000 seconds there,
so at first I thought it was hung in an infinite loop.
No patience here, at least not 1000s worth ;-)
This isn't a show-stopper for the coreutils release.
- OpenBSD 4.7 vs nanosleep,
Jim Meyering <=