public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/3886] New: clock_nanosleep() does not return an error when its first argument is out of range
@ 2007-01-18 13:30 bart dot vanassche at gmail dot com
2007-01-18 16:22 ` [Bug libc/3886] " bart dot vanassche at gmail dot com
0 siblings, 1 reply; 2+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-01-18 13:30 UTC (permalink / raw)
To: glibc-bugs
According to the clock_nanosleep manpage, clock_nanosleep() should return -1 and
set errno to ENOTSUP for clocks that are not supported. When specifying
CLOCK_MONOTONIC_HR as the first argument to clock_nanosleep(), it returns 0
instead of -1.
System details:
$ uname -a
Linux sabekorlnx05 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006
x86_64 x86_64 x86_64 GNU/Linux
$ rpm -q glibc
glibc-2.5-25
Test program:
$ cat clock_gettime.cpp
#include <iostream>
#include <iomanip>
#define CLOCK_MONOTONIC_HR 5 // see also <linux/time.h>
int main(int /*argc*/, char** /*argv*/)
{
timespec now;
if (clock_gettime(CLOCK_MONOTONIC_HR, &now) >= 0)
{
std::cout << now.tv_sec << '.'
<< std::setw(9) << std::setfill('0') << now.tv_nsec << std::endl;
}
else
{
perror("clock_gettime");
}
{
timespec delay;
delay.tv_sec = 1;
delay.tv_nsec = 0;
if (clock_nanosleep(CLOCK_MONOTONIC_HR, 0, &delay, 0) < 0)
perror("clock_nanosleep");
}
return 0;
}
// Local variables:
// compile-command: "for c in g++ ppc_440-g++; do $c -g -pg -Wall -Wextra
-Werror clock_gettime.cpp -o ${c%g++}clock_gettime -lrt; done"
// End:
--
Summary: clock_nanosleep() does not return an error when its
first argument is out of range
Product: glibc
Version: 2.4
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: bart dot vanassche at gmail dot com
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: x86_64-suse-linux-gnu
GCC host triplet: x86_64-suse-linux-gnu
GCC target triplet: x86_64-suse-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=3886
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug libc/3886] clock_nanosleep() does not return an error when its first argument is out of range
2007-01-18 13:30 [Bug libc/3886] New: clock_nanosleep() does not return an error when its first argument is out of range bart dot vanassche at gmail dot com
@ 2007-01-18 16:22 ` bart dot vanassche at gmail dot com
0 siblings, 0 replies; 2+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-01-18 16:22 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From bart dot vanassche at gmail dot com 2007-01-18 16:22 -------
Can't reproduce this myself anymore -- will try to find out first what went wrong.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://sourceware.org/bugzilla/show_bug.cgi?id=3886
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-01-18 16:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-18 13:30 [Bug libc/3886] New: clock_nanosleep() does not return an error when its first argument is out of range bart dot vanassche at gmail dot com
2007-01-18 16:22 ` [Bug libc/3886] " bart dot vanassche at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).