From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126488 invoked by alias); 17 Aug 2016 18:43:38 -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 126477 invoked by uid 89); 17 Aug 2016 18:43:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=discourage, our X-HELO: smtp.gentoo.org Date: Wed, 17 Aug 2016 18:43:00 -0000 From: Mike Frysinger To: Jeff Layton Cc: 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: <20160817184333.GC21655@vapier.lan> Mail-Followup-To: Jeff Layton , libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org, Michael Kerrisk , Carlos O'Donell , Yuriy Kolerov References: <1471445251-2450-1-git-send-email-jlayton@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8NvZYKFJsRX2Djef" Content-Disposition: inline In-Reply-To: <1471445251-2450-1-git-send-email-jlayton@redhat.com> X-SW-Source: 2016-08/txt/msg00531.txt.bz2 --8NvZYKFJsRX2Djef Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1253 On 17 Aug 2016 10:47, Jeff Layton wrote: > The Linux kernel expects a flock64 structure whenever you use OFD locks > with fcntl64. Unfortunately, you can currently build a 32-bit program > that passes in a struct flock when it calls fcntl64. >=20 > Only define the F_OFD_* constants when __USE_FILE_OFFSET64 is also > defined, so that the build fails in this situation rather than > producing a broken binary. this seems to be going against the glibc API/guarantees we've provided before (or at least tried to promise), and what the fcntl(2) man page says now. namely, we haven't documented F_GETLK64 or struct flock64, with the expectation that the user just calls fcntl() with a struct flock. in fact, the man page even goes so far as to discourage people from using the *64 variants. it should be possible using our existing LFS framework to make the OFD cmds available even to 32-bit apps (where sizeof(off_t) =3D=3D 32). but maybe the usage of F_GETLK64/struct flock64/etc... in the real world has made it hard to put that genie back in the bottle ? we'd have to version the current fcntl symbol, create a new fcntl symbol that does 32->64 munging, and add a new fcntl64 symbol that we'd transparently rewrite to when LFS is turned on. -mike --8NvZYKFJsRX2Djef Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXtLBVAAoJEEFjO5/oN/WBJbYP/0GPIW+R95vp/zcLE/a/K0Kw t+a/MxY5steL8aDBwqG/uMVfU5WbB1N+ZmagFmhFi1Kn1HjxNIjinxI6tNYLkk9P Xzwp28I5W3c656+S2qIXEt7+DGHmv2d+bEyffmDM6U+B5UtAUIteVYA6PB4EVwtN w2D5sjMcJeUs2iYpk1YDnEP9ELAp3GcIx9t8Kri2xRjF6U/av3OZD2Y1sneOVrea 6qdxuXobSgJzGjLjN/1gMi9kVlC+XDNmv9Ec1sX+Esr1kr1VbJeE9ZmuK7QOhPTF IKtdhya3TpFIiWi/C4cJIv+2/+qocjv51lpOwDq/EOL+usUkyfFBObrhWqMpigK5 rTQsjV1jPNM4FVlLogUzS0WLB2JzKYwmTB6u08vR6UfHpvWYHw8uV7tDzX330v6b 4hBs4oO9NEoes7jhbOjhs7OXhh7d8tUEljQQfw3ii0amvTq8bVswZFA20MMw063U USi/rSsUBFlEg9ZjlNkgXsZX4NX9WnnviA+8Uop5ZAGw0NUqcI+CXlrtaBx+U59+ SkdXE+BI18GrwDXWKmB9HbN/VbTAmAg0bQDChIfH6T/H/79JbKAiRN0ZFAwMbLI5 /XD/uX4aO5EU9bcuf3rOkZGQEvR1ctuTF+opSwBoxXaYFXcNPFC83Ie6MwBJPSZc ArSJInJgILaCnPkr+tN+ =GrGt -----END PGP SIGNATURE----- --8NvZYKFJsRX2Djef--