From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org ([140.211.166.183]:37654 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752728AbcHQSns (ORCPT ); Wed, 17 Aug 2016 14:43:48 -0400 Date: Wed, 17 Aug 2016 11:43:33 -0700 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> 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> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --8NvZYKFJsRX2Djef Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =66rom 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 -----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--