From: Andrew Morton <akpm@linux-foundation.org>
Date: Wed, 7 Nov 2007 23:09:16 -0800
You and I would say "wtf", but the manual states what it does:
On error, (clock_t) -1 is returned, and errno is set appro-
priately.
And I think this (obviously bogus) convention is something we
are really stuck with.
Another awful aspect of this is that glibc is going to overwrite
'errno' for this return value range. That will likely cause more
application misbehavior than some of the other side effects we've been
discussing.
In short we have two problems:
1) glibc thinks -4096 < x < 0 is an error, and will write this
value into errno and return -1 to the application
2) the manual states that -1 means error
-