From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by sourceware.org (Postfix) with ESMTPS id 067FB3858D3C for ; Wed, 8 Dec 2021 19:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 067FB3858D3C Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1F8CA5C009B; Wed, 8 Dec 2021 14:53:02 -0500 (EST) Received: from imap45 ([10.202.2.95]) by compute5.internal (MEProxy); Wed, 08 Dec 2021 14:53:02 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjeekgdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdgkrggt khcuhggvihhnsggvrhhgfdcuoeiirggtkhesohiflhhfohhlihhordhorhhgqeenucggtf frrghtthgvrhhnpefhuefhveeuffetfffgjeetgfekkeehfedtfeelgfehffffveehkeel fefgheffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpeiirggtkhesohiflhhfohhlihhordhorhhg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3639324A0074; Wed, 8 Dec 2021 14:53:01 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4492-g121c2470aa-fm-20211206.001-g121c2470 Mime-Version: 1.0 Message-Id: <47caa1d2-16bb-4d1a-b8c8-66b83efcce91@www.fastmail.com> In-Reply-To: <20211208173857.GV7074@brightrain.aerifal.cx> References: <20211207111957.8087-1-alx.manpages@gmail.com> <20211207214814.18553-1-alx.manpages@gmail.com> <20211208002911.GR7074@brightrain.aerifal.cx> <90c79268-f5a1-4990-84a5-fd0a508046d2@www.fastmail.com> <20211208030558.GS7074@brightrain.aerifal.cx> <20211208173857.GV7074@brightrain.aerifal.cx> Date: Wed, 08 Dec 2021 14:52:39 -0500 From: "Zack Weinberg" To: "Rich Felker" Cc: "'Alejandro Colomar (man-pages)'" , libc-alpha@sourceware.org, =?UTF-8?Q?=D0=BD=D0=B0=D0=B1?= , "Jakub Wilk" , "Stefan Puiu" , "Michael Kerrisk" , "H . J . Lu" , "Joseph Myers" Subject: Re: [RFC v2 1/2] sys/types.h: Define new type: snseconds_t Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham 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: Wed, 08 Dec 2021 19:53:05 -0000 On Wed, Dec 8, 2021, at 12:38 PM, Rich Felker wrote: > On Wed, Dec 08, 2021 at 09:34:39AM -0500, Zack Weinberg wrote: >> Universal practice is not necessarily correct. It was an error to >> define a structure type that's passed across the user/kernel >> boundary, with a field whose type isn't a typedef name. It has >> *always* been an error. And I have yet to see a compelling reason >> why the error should not be corrected. > > This is your ideology. I don't agree with it, and I hope others won't > too. Stop treating it as Truth folks are supposed to automatically > agree with you on. We have objective evidence that using a bare fundamental type for this field causes problems. You want to convince me that its type should not be changed, you should be offering actual _reasons_ to not change it, not just insisting that it's fine as is. Actual reasons, in my book, would include things like a real-world program that fails to compile in a way that cannot be fixed with local patches, or -- much more seriously -- a real-world program that recompiles fine but then produces incorrect output when run. >> I looked through the source code to musl and I could not find the >> definition of struct timespec ... > > include/alltypes.h.in is also used, and contains: > > STRUCT timespec { time_t tv_sec; int > :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; > int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); }; > > which is just time_t tv_sec and long tv_nsec surrounded by the > appropriate anonymous padding for endianness and sizeof(long). Ah, I see how it works now, thanks. zw