From nobody Fri Sep 12 13:58:31 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cNbcV6Cbxz67V0C for ; Fri, 12 Sep 2025 13:58:34 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4cNbcV427vz3twL; Fri, 12 Sep 2025 13:58:34 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=citron; t=1757685512; x=1758352178; h=date:author:from:to:cc:subject: message-id:in-reply-to:references:mail-followup-to:openpgp:blahblahblah: mime-version:content-type:author:from:subject:date:to:cc:resent-author: resent-date:resent-from:resent-sender:resent-to:resent-cc:resent-reply-to: resent-message-id:in-reply-to:references:mime-version:content-type: content-transfer-encoding:content-disposition:content-id: content-description:message-id:mail-followup-to:openpgp:blahblahblah; bh=nPzXnMiM1fxy1NmBzk/vUoou5KG8GyOJpamD/Ke75m4=; b=aJseT7LlY0u2Fer5vas8BsBdP0iCrCUU4yJvkaUmDaKSny0pKg9iNqfYUrkITff+TgZUloRo omGRWjR1oJrGOv9D1zUPdCSgXF3nXp4KvkCJk16APnv0vr+gthdGUx/m9F5ZDlbos3UNZ7Tv1G QAFVdfF3Ie8NrZcAh++G6AsNTNoQ0SMquj0mSH9pyZy6EalB7u72P8zuQdngdItdabXzp/ooVl haLYZS4+vHZ9imRTgpVQR/VGzrJD3U8Et6jADiBkhj1yseocb0n8gLt/GbQ1/fBYr/cxvGAM6R kTwPk6wOp91HKsULv0GqkpP3aNwGKmyge0kzor34NFKNew3A== Date: Fri, 12 Sep 2025 15:58:31 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: FreeBSD Current Cc: Olivier Certner , Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= , Bob Bishop , Alan Somers , Toomas Soome Subject: Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88] Message-ID: <20250912135831.s1k7SkfL@steffen%sdaoden.eu> In-Reply-To: <5035133.Cjmsv3J8Qz@ravel> References: <1F6A4621-1505-4F78-97C6-85EA556B2165.ref@yahoo.com> <6053312.Zv9zXsTiuT@ravel> <86ms6zhmbq.fsf@ltc.des.dev> <5035133.Cjmsv3J8Qz@ravel> Mail-Followup-To: FreeBSD Current , Olivier Certner , Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= , Bob Bishop , Alan Somers , Toomas Soome User-Agent: s-nail v14.9.25-709-g8a51e128fe-dirty OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4cNbcV427vz3twL Olivier Certner wrote in <5035133.Cjmsv3J8Qz@ravel>: |> readdir_r() should never have existed. ... |most programs calling it do not do the proper dance[.] ... |Yes, that's a fundamental problem for a flexible unionfs where the \ |upper and lower layers can be changed underneath the union view. But \ |we have a workaround here: Simply return NAME_MAX[.] ... |>[.]It is |> also faster than readdir_r(). | |I completely agree, but see these more as points to actually obsolete \ |readdir_r(), as POSIX just did (and we did long ago). We'll eventually \ |remove it anyway. Only to mention that POSIX Issue 8 has posix_getdents() that gives application programmers a good tool for flexible buffer usage ("none to many" dirents in one go, as you need it), as well as lots of *stat*(2) avoidance possibilities. This is a real improvement when available, and i hope the world will go this route, so that the only optional getdirentries() / getdents() / getdents64() / readdir()+stat() dances will come to an end in the future. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)