Patch: Convert linux-generic to use <bits/fcntl-linux.h>
Andreas Jaeger
aj@suse.com
Thu Oct 25 06:12:00 GMT 2012
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?
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
More information about the Libc-alpha
mailing list