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: 660520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sFbvg0bM0z9t0p for ; Fri, 19 Aug 2016 05:37:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=EBLWTgTi; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=VohV t8tRlipqAl56AM0nAe9HUIpJH0Tssa+ayHxOl7JajEkxtAJSP/cZXJZzTrQ3c0Sz wX/TItpMUZqD5bBypAEKfCrlmX5qyVzvfgeuSO5j5YFc5yWxYSqG3Ie5NdJlQPCN 3JGyNv7JQFjEYn7Fa9k9DAnnGgIVTvWyCg7utrk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=j9QSswuRcZ BftngrjP5oVjXhXDg=; b=EBLWTgTilSW66Dn8ib+Fe4ZK1PPwqcM+hbeeZIrO85 CVVUfndGYJ4kOfB1cM0OT8QMTIiJffsFzNrRwv4BxHB0JNC2GymEWv6n6Iyukxna u3asSMMjrgh6dcKUzvjqO9xlgYX4GOLBQrikNESqcrvbEjgOq8WtEDXiVTfTyNXx U= 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