From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:57191 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752582AbcHQVfo (ORCPT ); Wed, 17 Aug 2016 17:35:44 -0400 Date: Wed, 17 Aug 2016 23:30:34 +0200 From: Cyril Hrubis To: Jeff Layton , libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org, Michael Kerrisk , Carlos O'Donell , Yuriy Kolerov Subject: Re: [glibc PATCH] fcntl: put F_OFD_* constants under #ifdef __USE_FILE_OFFSET64 Message-ID: <20160817213033.GA20169@rei.lan> References: <1471445251-2450-1-git-send-email-jlayton@redhat.com> <20160817184333.GC21655@vapier.lan> <1471461304.3196.101.camel@redhat.com> <20160817200305.GE21655@vapier.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817200305.GE21655@vapier.lan> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi! > the trouble is that glibc only does fcntl->fcntl64, it doesn't do any > other cmd or arg translation. that means users are forced to pick the > right cmd (FOO or FOO64) that matches the LFS build mode. i.e. they > can't use FOO w/LFS turned on, and they can't use FOO64 w/LFS turned > off. otherwise there's a mismatch in the struct flock. One way to fix that would be to add fcntl32() that does the flock <-> flock64 translation for F_OFD_XXX and calls the generall fcntl() implementation. Then select between fcntl() and fctnt32() on 32bit architectures based on _FILE_OFFSET_BITS in the preprocessor in the fcntl header. That way we wouldn't have to touch the kernel at all. -- Cyril Hrubis chrubis@suse.cz