From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org ([140.211.166.183]:45854 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752296AbcHQQNl (ORCPT ); Wed, 17 Aug 2016 12:13:41 -0400 Date: Wed, 17 Aug 2016 09:13:11 -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: <20160817161311.GA21655@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="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <1471445251-2450-1-git-send-email-jlayton@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --vtzGhvizbBRQ85DL 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. what about ILP32 targets like x32 ? sizeof(flock) =3D=3D sizeof(flock64) is the same there. > --- a/manual/examples/ofdlocks.c > +++ b/manual/examples/ofdlocks.c > @@ -15,6 +15,7 @@ > along with this program; if not, see . > */ > =20 > +/* Note that this must be built with -D_FILE_OFFSET_BITS=3D64 on 32-bit = arch */ GNU style says comments are complete sentences (so ends with a period), and there's two spaces after the period. > --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h > +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h > @@ -127,11 +127,18 @@ > This means that they are inherited across fork or clone with CLONE_FI= LES > like BSD (flock) locks, and they are only released automatically when= the > last reference to the the file description against which they were ac= quired > - is put. */ > + is put. > + > + Note that the kernel does not support the legacy struct flock on 32-b= it > + arches with OFD locks. On those arches you need define both _GNU_SOUR= CE > + and _FILE_OFFSET_BITS=3D64. > + */ comment style says the */ has to be on the previous line -- look at how the code looked before your change. also, two spaces after periods. -mike --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXtI0WAAoJEEFjO5/oN/WBm0EQALjvAQ0LQUmFTwp36XNNVlh0 +y4fYtKZ/GpIFwa7qJeuPMNj2T6xrm3eqKdvz4D6FC7Jh72CfrGtHXWS42lbF53s kqVM88UMN76cm0SvMd4jpl2CNh9CMloYRb9Tt8W5Yad1JuUGcbd34pF4nGONNJjS qAUW6v3MA6hDmwU2O3xCTkCYDnwCBkFkqhzG/SF6s7Gtdsbj0jLCVj3AX89af0KD pfuaI1QNOy/Qv216NZYcsVdFG/D26uyZRVXZOL2Z1ICg3ovCcpwSO9ANcqc0o/hR JizVvfs7BoSjo9lFgvfiOXQg6tIs6u3s00WmbfKEbB+F91/qP8qglzl6BEow4ie7 E8vZfUaeCup16RN9Fr/hpbvlMh/kTTQ528IaHfwGA7ZE33WsbuWUJwpnFixtROeL 12g3tEKXb4XG4gbhUn8meHYThwm8itCKw4I2eDJ4HG77SYmHU7kSFZx+ypRZEVtE XVJ8PHbl4uZMaYc8sWk98VHgK+XpdJiFaqeSdQBe9mJ15v7U7phc6cATrUYl4uRj gzX7mz7EWsFb7mSjYo6LxSKXbwd0oipcILLZNJHh5kXwc2Rrx1k6dk04X3xnqOOg qOYi9IdfI063xf/R6CXudFxsgjRyku02plrgMrjYI/9o+LMbmuWMPq7ITedsfXBY sKnL5YdlTR7IgHCFmb25 =vsFn -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--