From patchwork Thu Aug 18 19:36:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 14763 Received: (qmail 104836 invoked by alias); 18 Aug 2016 19:36:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 104824 invoked by uid 89); 18 Aug 2016 19:36:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1305, sketch X-HELO: zimbra.cs.ucla.edu Subject: Re: [Linux PATCH] fcntl: add new F_OFD_*32 constants and handle them appropriately To: Zack Weinberg , Christoph Hellwig References: <1471521804-4291-1-git-send-email-jlayton@redhat.com> <20160818170508.GA897@lst.de> <1471541300.2504.23.camel@redhat.com> <20160818173139.GA1140@lst.de> <20160818174607.GL21655@vapier.lan> <20160818175246.GA1433@lst.de> Cc: Jeff Layton , linux-fsdevel@vger.kernel.org, GNU C Library , chrubis@suse.cz From: Paul Eggert Message-ID: <01b37ffd-4ec7-ce69-c7e1-891162f3e4d8@cs.ucla.edu> Date: Thu, 18 Aug 2016 12:36:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Zack Weinberg wrote: > We could change the libc headers used on old-ILP32 ABIs so that > _FILE_OFFSET_BITS=64 is defined by default (matching the LP64-ABI > headers). This would break the ABI of every shared library that > exports a structure (transitively) containing a field of type off_t, > ino_t, fsblkcnt_t, fsfilcnt_t, or rlim_t. As I understand it, most (all important?) such libraries are already compiled with _FILE_OFFSET_BITS=64 anyway, so their ABIs wouldn't break. How about if we start the transition by deprecating the use of 32-bit off_t in user or library code on platforms with 32-bit long? The attached patch plus lots of similar patches, say (this is just a sketch). Really, it's long since time that file offsets were 64 bits. diff --git a/libio/stdio.h b/libio/stdio.h index e37f901..a5f65e9 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -88,7 +88,11 @@ typedef _G_va_list va_list; #if defined __USE_UNIX98 || defined __USE_XOPEN2K # ifndef __off_t_defined # ifndef __USE_FILE_OFFSET64 +# if !_SUPPRESS_FILE_OFFSET_DEPRECATION && __LONG_MAX__ < __LONG_LONG_MAX__ +typedef __off_t off_t __attribute_deprecated__; +# else typedef __off_t off_t; +# endif # else typedef __off64_t off_t; # endif