From nobody Mon Sep 15 17:13:52 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 4cQWpV5Xqzz67fT5 for ; Mon, 15 Sep 2025 17:13:54 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cQWpV4nrGz3q3g; Mon, 15 Sep 2025 17:13:54 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757956434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hkcbK0VH1Zuu8YKkCJkFWRvr1Ctx2voPIZVP1fimCoU=; b=g6x64n9TkhdAaZmv904y3Vb5fMn6UMqMVVGsowJ6F7O6qwj28n3bcYYmbKwmGjonkMBRvU x+jDZ/e5RnsndG4anmqhSHBHozTGpCk9YeqRChGe6yQICa2nqZLvJ1GqfeJ1sEbGg7GZaA kP6nTZTEgJLXzpeS9IPo56Lpehi8KpvhIXIvZFOgc+Xb9/FQ6c3RkUxCjmB+INZki9XRtb hx2cdCAFn9y2Iw2DUTCr/qGxtioQ/yK53z0ntPBUcTolABgxMJdowH5v9QN4vrbl4RA3x9 He9pz68q8wbYuApV7bjaUwMzv6EvHPohXfGLqRMKgAREbSrj2o9IUtRtWSU2jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757956434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hkcbK0VH1Zuu8YKkCJkFWRvr1Ctx2voPIZVP1fimCoU=; b=bvnOe7iMl94SgkUVps8RUlP9/fDp73CjC1DPK/B/gqh1GPyd67EwyJBHvofwPsbT2SPbRB 0l4rE6kOAIQGH6gAyFeSfjQPkm/fDIuq47dX/AIaG9MBE7HxXUK/fsZ3DYpkbIcIoLyj1U VuDRHvmgCEzuwY4FXaisrAHcrX19EM+k0EMdNoA5jiF5bk+08zvCeB4zvJyGB+YTmh2kyQ gqxd45IA8mgKx/gpaNE7HPfCMzrsP2X/dUjsX7jW62k18IGYXGXKtIL3HVA8uBR3m4g04e lem1bfEHGPXzqgrAvc66DVifex6XGbA4oGBC8Oxd1bfrUKpgolclhmDgjke4xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757956434; a=rsa-sha256; cv=none; b=Gy1iKLSglN4LltVFk3yETrmXnOHAbz50El23Iui1K2NBABc2CojJZR+nvibqoTksHJPZ75 ZyXl97TEcrz/kaUyGFFoVnPTAE6ZxEDwS5EUFlWqhisqViJAhWXBWMIt84B2ueNWQo9CX9 gnNfUean9XJ6IOvHfEiwYg12YehbTqgIFm1bmCCeYi0URWts0N0dF75vzwLF3x+32ZxdZk NuKCPHdTY/QiKGfV1C6ENGGLj6FAezDyDt1YrxUuGEBTPm7HKgovBIG56H9vWAtst2JLHO Dt2FjNm6Lahx3nOQDp0akt2OGQl7ekgGaJefUo4TCukTZvBAtMAOhI1iIQDkWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from ltc.des.dev (88-177-82-251.subs.proxad.net [88.177.82.251]) (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) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cQWpV3Ddlz19Lc; Mon, 15 Sep 2025 17:13:54 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 9A7B082139; Mon, 15 Sep 2025 19:13:52 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: rb@gid.co.uk Cc: Olivier Certner , FreeBSD Current , Alan Somers , Toomas Soome Subject: Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88] In-Reply-To: (rb@gid.co.uk's message of "Fri, 12 Sep 2025 20:09:33 +0100") References: <1F6A4621-1505-4F78-97C6-85EA556B2165.ref@yahoo.com> <4148862.BRNeRiNLvY@ravel> <0F481EDD-24F4-4F2C-BCBB-9B016DD313F3@gid.co.uk> <86qzwcgcmp.fsf@ltc.des.dev> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Mon, 15 Sep 2025 19:13:52 +0200 Message-ID: <865xdjhc4v.fsf@ltc.des.dev> 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=utf-8 Content-Transfer-Encoding: quoted-printable rb@gid.co.uk writes: > Dag-Erling Sm=C3=B8rgrav writes: > > No, because readdir_r() has no way of knowing the size of the buffer > > that was passed to it. > It doesn=E2=80=99t need to know. > > If NAME_MAX is defined, the user must supply an adequately sized > buffer (based on NAME_MAX) or shoot themselves in the foot. > > If NAME_MAX is indefinite, readdir_r() returns EOVERFLOW immediately. =E2=80=9Cwe have this neat function called readdir_r(), you should try it, = it's slower than readdir() and more difficult to use and sometimes it doesn't work so you have to be prepared to fall back to readdir() when that happens, but apart from that I really like it=E2=80=9D DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org