[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071107.231440.145888291.davem@davemloft.net>
Date: Wed, 07 Nov 2007 23:14:40 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: akpm@...ux-foundation.org
Cc: paulus@...ba.org, lkml@...idb.org, linux-kernel@...r.kernel.org,
drepper@...hat.com, mtk-manpages@....net
Subject: Re: compat_sys_times() bogus until jiffies >= 0.
From: Andrew Morton <akpm@...ux-foundation.org>
Date: Wed, 7 Nov 2007 23:09:16 -0800
> I don't think that's a big problem? This syscall can (oddly) return any
> 32-bit (64-bit) number and a smart application developer (after saying wtf)
> would realise that he just can't check for errors and have correctly
> working code.
>
> Then again, if he was smart he just wouldn't use times(2)'s return value
> for anything. But what is the alternative? I don't think there is one,
> apart from much saner things like gettimeofday().
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists