From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f182.google.com ([209.85.216.182]:33834 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752629AbcHQRuB (ORCPT ); Wed, 17 Aug 2016 13:50:01 -0400 Received: by mail-qt0-f182.google.com with SMTP id u25so52475609qtb.1 for ; Wed, 17 Aug 2016 10:50:00 -0700 (PDT) Message-ID: <1471456198.3196.43.camel@redhat.com> Subject: Re: [glibc PATCH] fcntl: put F_OFD_* constants under #ifdef __USE_FILE_OFFSET64 From: Jeff Layton To: Joseph Myers Cc: libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org, Michael Kerrisk , Carlos O'Donell , Yuriy Kolerov Date: Wed, 17 Aug 2016 13:49:58 -0400 In-Reply-To: References: <1471445251-2450-1-git-send-email-jlayton@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2016-08-17 at 15:44 +0000, Joseph Myers wrote: > On Wed, 17 Aug 2016, Jeff Layton wrote: > > > > > +# if __WORDSIZE != 32 || defined __USE_FILE_OFFSET64 > > Are you sure __WORDSIZE is always defined here?  I don't see an include of  > in this header. > > Are you sure __WORDSIZE != 32 is the right condition on all architectures  > for the flock and flock64 structures being the same?  Wordsize is not a  > particularly well-defined concept all cases.  More specific tests tend to  > be preferred, e.g. __OFF_T_MATCHES_OFF64_T in bits/typesizes.h (so this  > would indicate having a new macro __FLOCK_MATCHES_FLOCK64 and arranging  > for it to be defined to 1 or 0 correctly in all cases - or at least a  > careful analysis of all architectures using this file to show that some  > other conditional is always correct). > Ok, that makes sense -- thanks. The only difference between struct flock and flock64 is the size of the offset values. So, I think that __OFF_T_MATCHES_OFF64_T would suffice here, actually. Is there any reason to do anything more elaborate than this in place of what I proposed earlier?     #if defined __OFF_T_MATCHES_OFF64_T || defined __USE_FILE_OFFSET64 -- Jeff Layton