New testsuite failures on 6.9.x kernels: misc/tst-preadvwritev2 misc/tst-preadvwritev64v2

Trying to build this package on linux-6.9.1-arch1-(1/2) or linux-zen-6.9.1-arch1-(1/2) results in error, but not on linux-lts-6.6.31-2.

It also happens while using the default makepkg.conf or the previous one. Or even while disabling build flags all together.

build-log.txt

By doing find . -type f | grep "result" | xargs grep "FAIL" we find the culprit:

./misc/tst-preadvwritev2.test-result:FAIL: misc/tst-preadvwritev2                                                
./misc/tst-preadvwritev64v2.test-result:FAIL: misc/tst-preadvwritev64v2

Their .out files say:

error: tst-preadvwritev2-common.c:113: preadv2 did not fail with an invalid flag

And their .c file says:

static void
do_test_with_invalid_flags (void)
{
  /* Set the next bit from the mask of all supported flags.  */
  int invalid_flag = RWF_SUPPORTED != 0 ? __builtin_clz (RWF_SUPPORTED) : 2;
  invalid_flag = 0x1 << ((sizeof (int) * CHAR_BIT) - invalid_flag);

  char buf[32];
  const struct iovec vec = { .iov_base = buf, .iov_len = sizeof (buf) };
  if (preadv2 (temp_fd, &vec, 1, 0, invalid_flag) != -1)
    FAIL_EXIT1 ("preadv2 did not fail with an invalid flag");
  if (errno != ENOTSUP)
    FAIL_EXIT1 ("preadv2 failure did not set errno to ENOTSUP (%d)", errno);

  /* This might fail for compat syscall (32 bits running on 64 bits kernel)
     due a kernel issue.  */
  if (pwritev2 (temp_fd, &vec, 1, 0, invalid_flag) != -1)
    FAIL_EXIT1 ("pwritev2 did not fail with an invalid flag");
  if (errno != ENOTSUP)
    FAIL_EXIT1 ("pwritev2 failure did not set errno to ENOTSUP (%d)", errno);
}