Do we need sys_open() et al (_LARGEFILE64_SOURCE and open64())?
Andreas Schneider
asn at cryptomilk.org
Mon Apr 2 04:31:28 MDT 2012
On Monday 26 March 2012 08:56:57 Andrew Bartlett wrote:
> On Sun, 2012-03-25 at 08:19 -0700, Jeremy Allison wrote:
> > On Sun, Mar 25, 2012 at 01:55:04PM +1100, Andrew Bartlett wrote:
> > > While we are thinking about sys_ wrappers, I wondered if we still really
> > > needed the sys_*() wrappers for open64 etc?
> > >
> > > man feature_test_macros(7) says:
> > > _LARGEFILE64_SOURCE
> > >
> > > Expose definitions for the alternative API specified by the LFS
> > > (Large File Summit) as a "transitional extension" to the Single UNIX
> > > Specification. (See http://opengroup.org/platform/lfs.html.) The
> > > alternative API consists of a set of new objects (i.e., functions and
> > > types) whose names are suffixed with "64" (e.g., off64_t versus off_t,
> > > lseek64() versus lseek(), etc.). New programs should not employ this
> > > interface; instead _FILE_OFFSET_BITS=64 should be employed.
> > >
> > > _FILE_OFFSET_BITS
> > >
> > > Defining this macro with the value 64 automatically converts
> > > references to 32-bit functions and data types related to file I/O and
> > > file system operations into references to their 64-bit counterparts.
> > >
> > > As such, are there any systems that we need that have
> > > _LARGEFILE64_SOURCE but not _FILE_OFFSET_BITS?
> > >
> > > Thanks,
> >
> > Oooh. That's a really good point. It would simplify
> > those interfaces. How do we find out if the open64
> > etc. are still being used on platforms ?
>
> I've done some research on the build farm. I've checked the size of
> off_t, as the way of knowing if large file support is in place:
>
> grep "checking size of off_t" build.samba_3_master*.log
>
> Every reporting host has off_t being 8 bytes. This is probably because
> we first declare _FILE_OFFSET_BITS 64.
Normally you should check with 'getconf LFS_CFLAGS' on systems with glibc. Not
sure if getconf is available on other systems.
-- andreas
--
Andreas Schneider GPG-ID: F33E3FC6
www.cryptomilk.org asn at cryptomilk.org
More information about the samba-technical
mailing list