From nobody Thu Feb 5 15:27:26 2026 X-Original-To: dev-commits-src-all@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 4f6Lgf3YBNz6QkqZ for ; Thu, 05 Feb 2026 15:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f6Lgf1dqqz3XMm for ; Thu, 05 Feb 2026 15:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770305246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9W20OrwnIXDsUy97h+mOQQsTa1jKGbaNlD13py6wEM=; b=hQNngA6vx4tuToqW0DgvTte0w0PFUSCkBR4pN7/qV+DdvZNZwazu0piH2K/Rdjjkm+BwQu uAV8bp3kH6c9FHqZfjlo51WP8GKqwPL/wP5+7j5jAhy+p7NmIlvNtFmL6AR93em7q1u252 V2Ah7oHunjcQzXTuj7tzxGgrDh5rj+yw+Xugyo3Jzonj4fHyvH79wbsXcD+Lg5HqTh1V6o pEilsNVgbsfizildMPG4FuwBidfQlVxRiI5l2vmPo2TZUjADnWzlnGcD3eYQKIE9HJjnak CVERURmB/TCQtmC4C4OSUXLVBQOnriJZV6OVaPDGU97NjaY+J5Bor42/FMw/Dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770305246; a=rsa-sha256; cv=none; b=dA/JXVJ1+DPD6QWnJPDj+6OlWp9Dk8VPhgQ0jtJwSFJgYTwZH3b/1I1b8xqOFHtZDD2k/M hEaC5RB8TUkiOxETjPXaJrMrtoIO8Rvo9pWMkX+JNt4MLC84guwlGjaGofWEOy3lD+TNTf Ks5X0PVrw+n6jvkMvZInDVbs+znhdOjSSsx0y2PB3zmaw5VwJRnAVePLktpOpGSFxqE42f AISgHck+RRHzUUyMHtorlb/7Wp4v7TTklnMhotx906Yx8YVSzX2dPQx90zVRYu33a/nLSk 75qERxhLJMg899gwXYL1Xxo8jRK1qHaKfMstYmDUpYJHswD1Uepmdi75VWJGww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770305246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9W20OrwnIXDsUy97h+mOQQsTa1jKGbaNlD13py6wEM=; b=CL5iY6Lt63sSnqNrP1Ns9H2ZkCualFyRcS9Ku/orzpHP7Q6VNYOQkLy2uZrsNXb+OT9d0o ihdRy4GDqrDGNTm0kQBoLj/iXb6wq0JuiLSahrO3Imm04DuGyMVBQIPdAQbUrYDLmpJfRo vYGhSv/CpytfevFscpnIoNUf3UCIkDsEK4zPhwUofQB8LabS7RIVJz1MwKNKVQk7B3XW95 A5bp7fShEnrWoGOCJ6ey7pBnyj9MalbBrIi8DpJyQ8Y4lO7g29CArhkyhkNjZCn1q1UIX3 7oKfOzPolnpDtzaLOuM+jH9f45Bmu+7N/85PvTjgBhejQYfm18p1NhhEt2nXaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f6Lgf19wXzZwV for ; Thu, 05 Feb 2026 15:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18a80 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Feb 2026 15:27:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 35f8b56a4123 - stable/14 - libc: Rename fscandir{,_b}() to fdscandir{,_b}(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 35f8b56a41230f5c0853c2e096af72e9e65fa0e5 Auto-Submitted: auto-generated Date: Thu, 05 Feb 2026 15:27:26 +0000 Message-Id: <6984b6de.18a80.12e381f6@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=35f8b56a41230f5c0853c2e096af72e9e65fa0e5 commit 35f8b56a41230f5c0853c2e096af72e9e65fa0e5 Author: Dag-Erling Smørgrav AuthorDate: 2025-06-23 13:02:53 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-02-05 14:47:46 +0000 libc: Rename fscandir{,_b}() to fdscandir{,_b}(). This seems to fit the pattern better (e.g. fdopendir()). I've added weak references to ease the transition, but since it's only been a few days, we can remove them (and the ObsoleteFiles entries for the manual pages) before we branch stable/15. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50980 (cherry picked from commit 0a5b763d98b921f921243525ff25a70bbe00cfaa) libc: Finish removing fscandir{,_b}(). These only existed for a few days before being renamed, so there's no reason to continue to carry compatibility shims for them. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50981 (cherry picked from commit ccf937320a1a7383a2c33698007b7244f66dc022) --- include/dirent.h | 4 ++-- lib/libc/gen/Makefile.inc | 4 ++-- lib/libc/gen/Symbol.map | 4 ++-- lib/libc/gen/scandir.3 | 28 ++++++++++++++-------------- lib/libc/gen/scandir.c | 8 ++++---- lib/libc/tests/gen/scandir_blocks_test.c | 12 ++++++------ lib/libc/tests/gen/scandir_test.c | 12 ++++++------ usr.bin/diff/diffdir.c | 2 +- 8 files changed, 37 insertions(+), 37 deletions(-) diff --git a/include/dirent.h b/include/dirent.h index eef335694bfb..6679f28284b9 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -132,11 +132,11 @@ int scandir_b(const char *, struct dirent ***, #endif #endif #if __BSD_VISIBLE -int fscandir(int, struct dirent ***, +int fdscandir(int, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); #ifdef __BLOCKS__ -int fscandir_b(int, struct dirent ***, +int fdscandir_b(int, struct dirent ***, int (^)(const struct dirent *), int (^)(const struct dirent **, const struct dirent **)); #endif diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index de7866429aee..ea926d23b325 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -506,8 +506,8 @@ MLINKS+=recv.2 recvmmsg.2 MLINKS+=rtld_get_var.3 \ rtld_set_var.3 MLINKS+=scandir.3 alphasort.3 \ - scandir.3 fscandir.3 \ - scandir.3 fscandir_b.3 \ + scandir.3 fdscandir.3 \ + scandir.3 fdscandir_b.3 \ scandir.3 scandir_b.3 \ scandir.3 scandirat.3 \ scandir.3 scandirat_b.3 \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index b2e9d4da0669..890d826c3c6e 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -461,8 +461,8 @@ FBSD_1.8 { aio_read2; aio_write2; execvpe; - fscandir; - fscandir_b; + fdscandir; + fdscandir_b; psiginfo; rtld_get_var; rtld_set_var; diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3 index c55c69eeca24..1d26d9f8be34 100644 --- a/lib/libc/gen/scandir.3 +++ b/lib/libc/gen/scandir.3 @@ -32,11 +32,11 @@ .Os .Sh NAME .Nm scandir , -.Nm fscandir , +.Nm fdscandir , .Nm scandirat , .Nm scandir_b , -.Nm fscandir_b , -.Nm fscandirat_b , +.Nm fdscandir_b , +.Nm fdscandirat_b , .Nm alphasort , .Nm versionsort .Nd scan a directory @@ -52,7 +52,7 @@ .Fa "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" .Fc .Ft int -.Fo fscandir +.Fo fdscandir .Fa "int dirfd" .Fa "struct dirent ***namelist" .Fa "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp" @@ -74,7 +74,7 @@ .Fa "int \*(lp^compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" .Fc .Ft int -.Fo fscandir_b +.Fo fdscandir_b .Fa "int dirfd" .Fa "struct dirent ***namelist" .Fa "int \*(lp^select\*(rp\*(lpconst struct dirent *\*(rp" @@ -146,7 +146,7 @@ The memory allocated for the array can be deallocated with by freeing each pointer in the array and then the array itself. .Pp The -.Fn fscandir +.Fn fdscandir function is similar to .Fn scandir , but takes a file descriptor referencing a directory instead of a path. @@ -187,12 +187,12 @@ for additional details. .Pp The .Fn scandir_b , -.Fn fscandir_b , +.Fn fdscandir_b , and .Fn scandirat_b functions behave in the same way as .Fn scandir , -.Fn fscandir , +.Fn fdscandir , and .Fn scandirat , respectively, @@ -203,10 +203,10 @@ rather than .Sh DIAGNOSTICS The .Fn scandir , -.Fn fscandir , +.Fn fdscandir , .Fn scandirat , .Fn scandir_b , -.Fn fscandir_b , +.Fn fdscandir_b , and .Fn scandirat_b functions return the number of directory entries found on succes. @@ -238,9 +238,9 @@ and .Fn versionsort functions are GNU extensions and conform to no standard. The -.Fn fscandir , +.Fn fdscandir , .Fn scandir_b , -.Fn fscandir_b , +.Fn fdscandir_b , and .Fn scandirat_b functions are @@ -264,8 +264,8 @@ and functions were added in .Fx 13.2 . The -.Fn fscandir , -.Fn fscandir_b , +.Fn fdscandir , +.Fn fdscandir_b , and .Fn scandirat_b functions were added in diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 36abe9f37047..eee8e39cb7eb 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -161,10 +161,10 @@ scandir(const char *dirname, struct dirent ***namelist, int #ifdef I_AM_SCANDIR_B -fscandir_b(int dirfd, struct dirent ***namelist, select_block select, +fdscandir_b(int dirfd, struct dirent ***namelist, select_block select, dcomp_block dcomp) #else -fscandir(int dirfd, struct dirent ***namelist, +fdscandir(int dirfd, struct dirent ***namelist, int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, const struct dirent **)) #endif @@ -205,9 +205,9 @@ scandirat(int dirfd, const char *dirname, struct dirent ***namelist, return (-1); ret = #ifdef I_AM_SCANDIR_B - fscandir_b + fdscandir_b #else - fscandir + fdscandir #endif (fd, namelist, select, dcomp); serrno = errno; diff --git a/lib/libc/tests/gen/scandir_blocks_test.c b/lib/libc/tests/gen/scandir_blocks_test.c index 28aeef4e7d4c..b94270bc410e 100644 --- a/lib/libc/tests/gen/scandir_blocks_test.c +++ b/lib/libc/tests/gen/scandir_blocks_test.c @@ -57,19 +57,19 @@ ATF_TC_BODY(scandir_b_test, tc) free(namelist); } -ATF_TC(fscandir_b_test); -ATF_TC_HEAD(fscandir_b_test, tc) +ATF_TC(fdscandir_b_test); +ATF_TC_HEAD(fdscandir_b_test, tc) { - atf_tc_set_md_var(tc, "descr", "Test fscandir_b()"); + atf_tc_set_md_var(tc, "descr", "Test fdscandir_b()"); } -ATF_TC_BODY(fscandir_b_test, tc) +ATF_TC_BODY(fdscandir_b_test, tc) { struct dirent **namelist = NULL; int fd, i, ret; scandir_blocks_prepare(tc); ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); - ret = fscandir_b(fd, &namelist, + ret = fdscandir_b(fd, &namelist, ^(const struct dirent *ent) { return (strcmp(ent->d_name, "skip") != 0); }, @@ -112,7 +112,7 @@ ATF_TC_BODY(scandirat_b_test, tc) ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, scandir_b_test); - ATF_TP_ADD_TC(tp, fscandir_b_test); + ATF_TP_ADD_TC(tp, fdscandir_b_test); ATF_TP_ADD_TC(tp, scandirat_b_test); return (atf_no_error()); } diff --git a/lib/libc/tests/gen/scandir_test.c b/lib/libc/tests/gen/scandir_test.c index dcd73fe94df5..9a9940aca881 100644 --- a/lib/libc/tests/gen/scandir_test.c +++ b/lib/libc/tests/gen/scandir_test.c @@ -63,19 +63,19 @@ ATF_TC_BODY(scandir_test, tc) free(namelist); } -ATF_TC(fscandir_test); -ATF_TC_HEAD(fscandir_test, tc) +ATF_TC(fdscandir_test); +ATF_TC_HEAD(fdscandir_test, tc) { - atf_tc_set_md_var(tc, "descr", "Test fscandir()"); + atf_tc_set_md_var(tc, "descr", "Test fdscandir()"); } -ATF_TC_BODY(fscandir_test, tc) +ATF_TC_BODY(fdscandir_test, tc) { struct dirent **namelist = NULL; int fd, i, ret; scandir_prepare(tc); ATF_REQUIRE((fd = open("dir", O_DIRECTORY | O_RDONLY)) >= 0); - ret = fscandir(fd, &namelist, scandir_select, scandir_compare); + ret = fdscandir(fd, &namelist, scandir_select, scandir_compare); scandir_verify(tc, ret, namelist); for (i = 0; i < ret; i++) free(namelist[i]); @@ -127,7 +127,7 @@ ATF_TC_BODY(scandir_none, tc) ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, scandir_test); - ATF_TP_ADD_TC(tp, fscandir_test); + ATF_TP_ADD_TC(tp, fdscandir_test); ATF_TP_ADD_TC(tp, scandirat_test); ATF_TP_ADD_TC(tp, scandir_none); return (atf_no_error()); diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c index 0eb0d07cd347..9ca9b5e1774e 100644 --- a/usr.bin/diff/diffdir.c +++ b/usr.bin/diff/diffdir.c @@ -84,7 +84,7 @@ vscandir(struct inodetree *tree, const char *path, struct dirent ***dirp, *dirp = NULL; return (0); } - if ((ret = fscandir(fd, dirp, selectf, comparf)) < 0) + if ((ret = fdscandir(fd, dirp, selectf, comparf)) < 0) goto fail; RB_INSERT(inodetree, tree, ino); close(fd);