xfs
[Top] [All Lists]

Re: [PATCH xfsprogs 2/2] linux.h: Define xfs_off_t as int64_t

To: Felix Janda <felix.janda@xxxxxxxxx>
Subject: Re: [PATCH xfsprogs 2/2] linux.h: Define xfs_off_t as int64_t
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 5 Aug 2016 21:52:39 +1000
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160805080241.GA749@nyan>
References: <20160730133737.GB5895@nyan> <20160801062449.GB596@xxxxxxxxxxxxx> <20160801065410.GA341@nyan> <20160804004747.GZ16044@dastard> <20160805080241.GA749@nyan>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Aug 05, 2016 at 10:02:41AM +0200, Felix Janda wrote:
> Dave Chinner wrote:
> > On Mon, Aug 01, 2016 at 08:54:10AM +0200, Felix Janda wrote:
> > > Christoph Hellwig wrote:
> > > > On Sat, Jul 30, 2016 at 03:37:37PM +0200, Felix Janda wrote:
> > > > > int64_t is guaranteed to have the correct size and signedness and is
> > > > > always avaible because linux.h has a <inttypes.h> include.
> > > > > 
> > > > > Fixes compilation error "unkown type name 'off64_t'" on linux when the
> > > > > public header <xfs.h> is included without _LARGEFILE64_SOURCE or
> > > > > _GNU_SOURCE defined. This bug was introduced in commit
> > > > > cb898f157f8410a03cf5f3400baa1df9e5eecd33.
> > > > 
> > > > I would much prefer to just define _LARGEFILE64_SOURCE in linux.h..
> > > 
> > > Thanks for the suggestion, but that does not work if the system header
> > > defining (or not) off64_t is included before the xfs headers.
> > 
> > Which, to me, is a build bug in whatever code is including the xfs
> > headers.  Isn't it the responsibility of the build environment to
> > ensure the dependencies of the libraries being used are correctly
> > met?
> 
> Every program using the xfs header is supposed to know that (only on
> linux) since commit cb898f157f8410a03cf5f3400baa1df9e5eecd33 it is
> necessary to define _LARGEFILE64_SOURCE or _GNU_SOURCE?

Which, I'd say, most already do, because anything trying to use XFS
ioctls needs to be 64 bit offset clean, even on 32 bit systems.  I
don't see any problem with requiring it when including a header
that exposes ioctl interfaces with 64 bit file size/offset fields
in them....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>