This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Convert linux-generic to use <bits/fcntl-linux.h>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]