|| ||Linus Torvalds <torvalds-AT-linux-foundation.org> |
|| ||Ulrich Drepper <drepper-AT-redhat.com> |
|| ||Re: Q: sys_futex() && timespec_valid() |
|| ||Mon, 28 Jun 2010 08:15:26 -0700|
|| ||Thomas Gleixner <tglx-AT-linutronix.de>,
Darren Hart <dvhltc-AT-us.ibm.com>, Ingo Molnar <mingo-AT-elte.hu>,
Peter Zijlstra <a.p.zijlstra-AT-chello.nl>,
Andreas Schwab <schwab-AT-redhat.com>,
Danny Feng <dfeng-AT-redhat.com>,
Jakub Jelinek <jakub-AT-redhat.com>, linux-kernel-AT-vger.kernel.org,
Oleg Nesterov <oleg-AT-redhat.com>|
|| ||Article, Thread
On Fri, Jun 25, 2010 at 1:04 PM, Ulrich Drepper <email@example.com> wrote:
> The tv_sec in timespec is of type time_t and for absolute time values the same
> semantics as for naked time_t values applies. The absolute time is
> epoch + tv_sec + tv_nsec / 1000000000
> If tv_sec is negative these are values before epoch.
That's a totally bogus argument.
Ulrich - you're wrong. Go away.
According to that same argument, negative tv_nsec values (or values
above a billion) would also be ok, since that expression would also
give some random value for time. So clearly, the fact that the
expression gives some random value does _not_ in any way mean that we
should accept that random value. Your "argument" isn't an argument at
all, it's just worthless random noise.
The fact is, a negative tv_sec could indeed mean "before the epoch",
but it could equally well (and way more likely) mean "totally buggy
application" or "overflow of a very large positive value".
In the end, it's quite simple: the kernel doesn't accept invalid
timevals. And negative tv_secs are invalid. It's that simple. If
somebody gives the kernel a timeout from before the epoch, that
somebody is being a total idiot. We know it's not a valid absolute
timeout, since there's no way somebody is "waiting" for something that
happened in the sixties.
Yeah, yeah, maybe you're waiting for flower power and free sex. Good
for you. But if you are, don't ask the Linux kernel to wait with you.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
to post comments)