From: Paul Mackerras <paulus@samba.org>
Date: Thu, 8 Nov 2007 12:53:57 +1100
I agree with this analysis.
The Linux man page for times() explicitly lists (clock_t) -1 as a
return value meaning error.
So even if we did make some effort to return errors "properly" (via
force_successful_syscall_return() et al.) userspace would still be
screwed because (clock_t) -1 would be interpreted as an error.
Actually I think this basically proves we cannot return (clock_t) -1
ever because all existing userland (I'm not talking about inside
glibc, I'm talking about inside of applications) will see this as an
error.
User applications have no other way to check for error.
This API is definitely very poorly designed, no matter which way we
"fix" this some case will remain broken.
-