All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/nolibc: drop readdir_r() override
Date: Mon, 2 Nov 2026 09:05:48 +0100	[thread overview]
Message-ID: <auhEXIPuSZknxJQQ@1wt.eu> (raw)
In-Reply-To: <20261102-nolibc-selftests-readdir_r-v1-1-58fd2205f1c6@weissschuh.net>

On Mon, Nov 02, 2026 at 03:27:35AM +0000, Thomas Weißschuh wrote:
> Running the testcases using readdir_r() on regular libcs is useful to
> detect mismatching behavior of nolibc. The deprecation warnings can be
> avoided with a compiler pragma instead.
> 
> Drop the override and enable the testcases relying on the function for
> regular libcs.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  tools/testing/selftests/nolibc/nolibc-test.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
> index 048c2d2850a9..1157b521e65b 100644
> --- a/tools/testing/selftests/nolibc/nolibc-test.c
> +++ b/tools/testing/selftests/nolibc/nolibc-test.c
> @@ -50,6 +50,7 @@
>  #include <alloca.h>
>  
>  #pragma GCC diagnostic ignored "-Wmissing-prototypes"
> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
>  
>  #include "nolibc-test-linkage.h"
>  
> @@ -99,10 +100,6 @@ static const int is_glibc =
>  #define strlcat(d, s, l) 0
>  #define strlcpy(d, s, l) 0
>  
> -/* readdir_r() is likely to be marked deprecated */
> -#undef readdir_r
> -#define readdir_r(dir, dirent, result) ((errno = EINVAL), -1)
> -
>  #define _syscall(...) 0
>  #endif
>  
> @@ -1802,8 +1799,8 @@ int run_syscall(int min, int max)
>  		CASE_TEST(ftruncate);         EXPECT_SYSZR(1, test_ftruncate()); break;
>  		CASE_TEST(getdents64_root);   EXPECT_SYSNE(1, test_getdents64("/"), -1); break;
>  		CASE_TEST(getdents64_null);   EXPECT_SYSER(1, test_getdents64("/dev/null"), -1, ENOTDIR); break;
> -		CASE_TEST(directories);       EXPECT_SYSZR(is_nolibc && proc, test_dirent()); break;
> -		CASE_TEST(dirfd);             EXPECT_SYSZR(is_nolibc && has_working_64bit_syscall_arg, test_dirfd()); break;
> +		CASE_TEST(directories);       EXPECT_SYSZR(proc, test_dirent()); break;
> +		CASE_TEST(dirfd);             EXPECT_SYSZR(has_working_64bit_syscall_arg, test_dirfd()); break;
>  		CASE_TEST(getrandom);         EXPECT_SYSZR(1, test_getrandom()); break;
>  		CASE_TEST(gettimeofday_tv);   EXPECT_SYSZR(1, gettimeofday(&tv, NULL)); break;
>  		CASE_TEST(gettimeofday_tv_tz);EXPECT_SYSZR(1, gettimeofday(&tv, &tz)); break;
> 
> ---
> base-commit: 228a318052869ab08f01f53b5cedfae0e930f6dd
> change-id: 20261102-nolibc-selftests-readdir_r-1dab2edffb12

Oh nice, I wasn't aware this one was possible. Nice to learn something
in the morning ;-)

Reviewed-by: Willy Tarreau <w@1wt.eu>

thanks,
Willy

      reply	other threads:[~2026-11-02  8:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  3:27 [PATCH] selftests/nolibc: drop readdir_r() override Thomas Weißschuh
2026-11-02  8:05 ` Willy Tarreau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auhEXIPuSZknxJQQ@1wt.eu \
    --to=w@1wt.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.