From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from brightrain.aerifal.cx (brightrain.aerifal.cx [216.12.86.13]) by sourceware.org (Postfix) with ESMTPS id 7BEA43858C27 for ; Thu, 9 Dec 2021 20:17:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7BEA43858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=libc.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=libc.org Date: Thu, 9 Dec 2021 15:17:17 -0500 From: Rich Felker To: Joseph Myers Cc: Paul Eggert , Adhemerval Zanella , "'Alejandro Colomar (man-pages)'" , Stefan Puiu , Andreas Schwab , Michael Kerrisk , =?utf-8?B?0L3QsNCx?= , Jakub Wilk , libc-alpha@sourceware.org, Zack Weinberg Subject: Re: [RFC v3 3/3] sys/types.h: Make snseconds_t user visible Message-ID: <20211209201717.GA7074@brightrain.aerifal.cx> References: <20211207111957.8087-1-alx.manpages@gmail.com> <20211208144757.37641-3-alx.manpages@gmail.com> <3a15b008-3173-018b-121b-4aeb817e378a@cs.ucla.edu> <20211208182506.GY7074@brightrain.aerifal.cx> <433b1982-f68a-402f-b89b-ed39d56b513e@www.fastmail.com> <3946d7a9-48cd-32bf-06dc-129181bdd8e7@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2021 20:17:20 -0000 On Thu, Dec 09, 2021 at 08:13:53PM +0000, Joseph Myers wrote: > On Thu, 9 Dec 2021, Paul Eggert wrote: > > > Nice idea, and we can simplify things more: we don't need that last line as > > the compiler will insert that padding for us on all glibc platforms that need > > it. Also, the code should use 'long int' consistently. Further, there's no > > On 32-bit x86, with _TIME_BITS=64, the structure is meant to have trailing > padding, but won't unless it's explicit (the alignment of long long in > structures is 4 bytes). To be clear: omitting the explicit padding here would be an ABI break *and* a buffer overflow, since the kernel will write 16 bytes but the struct would only be 12 bytes. Thus the explicit padding is mandatory. At least x86 (32-bit) and m68k are affected. I think there are a few other obscure archs without 8-byte alignment (maybe or1k or microblaze?) that might be too but I'm not sure of whether any of them are supported by glibc. Rich