]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Prefer setresuid32 in tst-setuid2
authorFlorian Weimer <fweimer@redhat.com>
Tue, 24 Sep 2024 11:48:11 +0000 (13:48 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 24 Sep 2024 11:48:11 +0000 (13:48 +0200)
Use the setresuid32 system call if it is available, prefering
it over setresuid.  If both system calls exist, setresuid
is the 16-bit variant.  This fixes a build failure on
sparcv9-linux-gnu.

nptl/tst-setuid2.c

index 33d4e39fff1d10b810acc427d74a3bc6991b586b..c41042301015b17ba68f963590062fc668069f9e 100644 (file)
@@ -76,7 +76,12 @@ run_on_thread (void (*func) (void))
 static void
 change_thread_ids (void)
 {
+#ifdef __NR_setresuid32
+  /* Prefer 32-bit setresuid32 over 16-bit setresuid.  */
+  long ret = syscall (__NR_setresuid32, 2001, 2002, 2003);
+#else
   long ret = syscall (__NR_setresuid, 2001, 2002, 2003);
+#endif
   if (ret != 0)
     FAIL ("setresuid (2001, 2002, 2003): %ld", ret);
 }