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: Andreas Jaeger <aj at suse dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Chris Metcalf <cmetcalf at tilera 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:12:05 +0200
- 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>
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