lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 31 Aug 2011 10:19:23 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Arnd Bergmann <arnd@...db.de>,
	Christoph Hellwig <hch@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"H.J. Lu" <hjl.tools@...il.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Richard Kuo <rkuo@...eaurora.org>,
	Mark Salter <msalter@...hat.com>,
	Jonas Bonn <jonas@...thpole.se>,
	Tobias Klauser <tklauser@...tanz.ch>
Subject: Re: RFD: x32 ABI system call numbers

On Wed, Aug 31, 2011 at 10:09 AM, H. Peter Anvin <hpa@...or.com> wrote:
>>
>> I suspect only sane solution to this (having thought about it some
>> more) is to just say "POSIX is f*^&ing wrong".
>
> Urk.  Someone had the bright idea of defining tv_nsec as "long" in the
> standard, whereas tv_usec is suseconds_t.  F**** brilliant, and more
> than a little bit stupid.

I think tv_nsec was just overlooked, and people thought "it has no
legacy users that were 'int', so we'll just leave it at 'long', which
is guaranteed to be enough for nanoseconds that only needs a range of
32 bits".

In contrast, tv_usec probably *does* have legacy users that are "int".

So POSIX almost certainly only looked backwards, and never thought
about users who would need to make it "long long" for compatibility
reasons.

The fact that *every*other*related*field* in POSIX/SuS has a typedef
exactly for these kinds of reasons just shows how stupid that "long
tv_nsec" thing is.

I suspect that on Linux we can just say "tv_nsec" is suseconds_t too.
Then we can make time_t and suseconds_t just match, and be "__s64" on
all new platforms.

                           Linus
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ