From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123555 invoked by alias); 23 Aug 2016 11:09:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 123543 invoked by uid 89); 23 Aug 2016 11:09:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*carlos, Cyril, cyril X-HELO: mx2.suse.de Date: Tue, 23 Aug 2016 11:09:00 -0000 From: Cyril Hrubis To: Florian Weimer Cc: Jeff Layton , Mike Frysinger , "Michael Kerrisk (man-pages)" , libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org, Carlos O'Donell , Yuriy Kolerov Subject: Re: [glibc PATCH] fcntl: put F_OFD_* constants under #ifdef __USE_FILE_OFFSET64 Message-ID: <20160823110343.GA4962@rei.suse.cz> References: <1471445251-2450-1-git-send-email-jlayton@redhat.com> <20160817184333.GC21655@vapier.lan> <1471461304.3196.101.camel@redhat.com> <1471464343.3196.125.camel@redhat.com> <20160817203746.GF21655@vapier.lan> <1471467478.3196.143.camel@redhat.com> <20160817213522.GG21655@vapier.lan> <1471470526.3196.153.camel@redhat.com> <8e1a972a-7966-139b-9d75-6d3a847a1be8@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8e1a972a-7966-139b-9d75-6d3a847a1be8@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-08/txt/msg00712.txt.bz2 Hi! > > So yeah, I think what I proposed before would probably be fine. But now > > that Michael pushed the issue, it's dawned on me that we may be able to > > get away with supporting it better if we turn the compatability > > mechanism on its head and use F_OFD_*32 constants in the non-LFS case. > > That's rather confusing to programmers, though. > > We then have: > > F_OFD_SETLK always 64-bit > F_SETLK 32-bit or 64-bit > F_SETLK64 always 64-bit (not recommended) > F_OFD_SETLK32 always 32-bit It's even worse, the F_OFD_SETLK32 in the proposed patch behaves exactly as F_SETLK so it's 32-bit or 64-bit depending on sizeof(long) in the kernel, that is because the compat fcntl64 converts struct flock from userspace to kernel struct flock and just call sys_fcntl() with the cmd it has. So in the end if you call fcntl with F_OFD_SETLK32 on 64bit kernel it expects flock64. -- Cyril Hrubis chrubis@suse.cz