From nobody Mon Sep 22 20:59: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 4cVwVH4qf4z68RCP for ; Mon, 22 Sep 2025 21:00:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cVwVG6CWYz3H8y for ; Mon, 22 Sep 2025 21:00:06 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=asomers@gmail.com Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-62fa99bcfcdso7035538a12.0 for ; Mon, 22 Sep 2025 14:00:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758574805; x=1759179605; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cRVsU5775RSLAga9P8qptqRDE/b8eDgvwyxYnarySyc=; b=kFiwBQPdqzuqY8RfHAIM8Bj5SM6b3AVgRN8Pg5c3r1awiUklbNeVR3WfkwYp4/qXac XPYI/ksyL5/IzCuwyUvdEjm0GHcBUzzHJOhFlgiXwWHVYpyxjr91S3CWB43T0ds2YNdG nEsus3LTfZq1kzsbMpmt0uX1dHx7PbzQFRFVya6V/edV1DZYQN92Kn+ybSfTavthyWUu HGm83DgkSDNUGGJ2DlLHKW7dgsmQEEHu1QO1tAN9z6ma3jKCOopTR4UJ36n0WjxurBLw JcSXi9rBsA7W7tnnGhXNOSoRYL+TEGe9G9aovidiVKHRhwUG5fqa3EyEkHns/q8qGM/d q96g== X-Gm-Message-State: AOJu0YxrbQhQARFOKx0SezzahIpx4MkrwKPGvu0zETgfLZ2Uhe18iGlv /83NiK5FgZMAScDMPFyV5vcRrOTsh/L3zF8Lgs543xhRJJvdpP/UfkjvS0AQvjOsDLnIKXZt0ls 66gW7exfWwQ8KoG9YL46NI3ZxIo48UVVATNRUf3w= X-Gm-Gg: ASbGncvhjoMA7xO30kIbkGIxqXw5CRVYTDH+sD7T94eiHAQ63tAjBAOiRB0Ay5eLogD 3QlLCCPI82QeCD8xFeazYWi9/9h9lcDvVf3VXZE9PB2pY1Lc5eUzBWJl0gXvPD9rCBl+UyWO/Ik qw3fE3kX4XdwdNq5OyDfdUvx1L2upYCJ193g4EnzKtC3RQ9qE/VesuiST+nCVccGq0AsyXO+I13 a1yiqw= X-Google-Smtp-Source: AGHT+IGM9UnWk6z9+cGNsKtEu/tQA1xMAN/QPBObxnJ/EmiPksWWJ0TKnNxo+23/lZGqSDDYtiU2pyBbjheS6x+WUs0= X-Received: by 2002:a05:6402:4557:b0:628:e8e3:ada with SMTP id 4fb4d7f45d1cf-634677f81abmr137426a12.27.1758574804612; Mon, 22 Sep 2025 14:00:04 -0700 (PDT) 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 From: Alan Somers Date: Mon, 22 Sep 2025 14:59:52 -0600 X-Gm-Features: AS18NWDKJZEuQlNWxvJjBCUONJ3bk3RnQ3y5UKQlekORAR5RBx-nsyavbM8qZOE Message-ID: Subject: The status of readdir_r in Rust To: FreeBSD CURRENT Content-Type: multipart/alternative; boundary="0000000000008a3982063f6a1a4c" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-0.998]; NEURAL_HAM_SHORT(-1.00)[-0.996]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[asomers]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_ONE(0.00)[1]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.51:from]; TO_DOM_EQ_FROM_DOM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.51:from] X-Rspamd-Queue-Id: 4cVwVG6CWYz3H8y --0000000000008a3982063f6a1a4c Content-Type: text/plain; charset="UTF-8" On 13-September we had a long conversation about readdir_r, about whether modern applications should be using it (they shouldn't), and about whether we should remove it entirely for FreeBSD 16 (no, at least not yet). The big problem was that lang/rust still used readdir_r in its standard library, so we definitely need to preserve that function for now. Since then I've submitted a PR to remove the readdir_r calls from the standard library [^1]. I also updated libc to specifically bind to the pre-FreeBSD 15 ELF symbol for readdir_r [^2], which ensures that applications will continue to build even after we remove that function. Finally, Github code search found several crates that are still using readdir_r, but only one of them is a crate that I personally care about: Nix. So I did the same thing there that I did to the standard library [^3]. At this point, I think it should be safe to remove readdir_r from FreeBSD 16 in about six months, at least as far as Rust is concerned. [^1]: https://github.com/rust-lang/rust/pull/146549 [^2]: https://github.com/rust-lang/libc/pull/4694 [^3]: https://github.com/nix-rust/nix/pull/2674 --0000000000008a3982063f6a1a4c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On 13-September we had a long conversation about read= dir_r, about whether modern applications=C2=A0should be using it (they shou= ldn't), and about whether we should remove it entirely for FreeBSD 16 (= no, at least not yet).=C2=A0 The big problem was that lang/rust still used = readdir_r in its standard library, so we definitely need to preserve that f= unction for now.

Since then I've submitted a P= R to remove the=C2=A0readdir_r calls from the standard library [^1].=C2=A0 = I also updated libc to specifically bind to the pre-FreeBSD 15 ELF symbol f= or readdir_r [^2], which ensures that applications will continue to build e= ven after we remove that function.=C2=A0 Finally, Github code search found = several crates that are still using readdir_r, but only one of them is a cr= ate that I personally care about: Nix.=C2=A0 So I did the same thing there = that I did to the standard library [^3].

At this p= oint, I think it should be safe to remove readdir_r from FreeBSD 16 in abou= t six months, at least as far as Rust is concerned.

[^1]:=C2=A0http= s://github.com/rust-lang/rust/pull/146549
--0000000000008a3982063f6a1a4c--