This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Patch: Convert linux-generic to use <bits/fcntl-linux.h>
- From: Chris Metcalf <cmetcalf at tilera dot com>
- To: Andreas Jaeger <aj at suse dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, "libc-ports at sourceware dot org"<libc-ports at sourceware dot org>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 25 Oct 2012 08:08:48 -0400
- Subject: Re: Patch: Convert linux-generic to use <bits/fcntl-linux.h>
- References: <50883C05.5090807@suse.com> <508841FA.4060104@tilera.com> <508849BF.50205@suse.com> <20121024203611.95D052C09B@topped-with-meat.com> <5088D835.2010904@suse.com>
On 10/25/2012 2:12 AM, Andreas Jaeger wrote:
> On 10/24/2012 10:36 PM, Roland McGrath wrote:
>>> We could have:
>>> #ifdef __USE_LARGEFILE64
>>> # if __WORDSIZE == 64
>>> # define O_LARGEFILE 0
>>> # else
>>> # define O_LARGEFILE __O_LARGEFILE
>>> # endif
>>> #endif
>>
>> That's too much hair. If there is a majority common value for
>> __O_LARGEFILE, then you can default __O_LARGEFILE to that value.
>> Beyond that, I'd say just leave it alone.
>>
>
>
> There are two majority values: Basically on 32-bit it'S 0100000 and on
> 64-bit systems it's 0. That's why we currently have
>
> #ifndef __O_LARGEFILE
> # define __O_LARGEFILE 0100000
> #endif
>
> #ifdef __USE_LARGEFILE64
> # define O_LARGEFILE __O_LARGEFILE
> #endif
>
> And 64-bit hosts define:
> /* Not necessary, files are always with 64bit off_t. */
> #define __O_LARGEFILE 0
>
> While x86 and others where we support both 32-bit and 64-bit arch have
> code like the following in <bits/fcntl.h>:
> #if __WORDSIZE == 64
> /* Not necessary, files are always with 64bit off_t. */
> # define __O_LARGEFILE 0
> #else
> # define __O_LARGEFILE 0100000
> #endif
>
> But since Mike mentioned that this won't work for MIPS, I suggest to
> leave the code as is in this case and not follow Chris' suggestion.
>
> Chris, may I commit the original patch?
Sure, I think that's reasonable. At least as-is we won't likely be adding
any more conditional definitions of __O_LARGEFILE anywhere, even as new
architectures are added.
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com