aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-09-24 13:48:11 +0200
committerFlorian Weimer <fweimer@redhat.com>2024-09-24 13:48:11 +0200
commitda29dc24d419656a4a6d6d61598b767b86b1425d (patch)
tree7b062bb92c114809b9cc09a5e01691bac413aab6
parent2abfa1907218c5ec9d52bb81bee3f1af652f67c7 (diff)
downloadglibc-da29dc24d419656a4a6d6d61598b767b86b1425d.tar.xz
glibc-da29dc24d419656a4a6d6d61598b767b86b1425d.zip
nptl: Prefer setresuid32 in tst-setuid2
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.
-rw-r--r--nptl/tst-setuid2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c
index 33d4e39fff..c410423010 100644
--- a/nptl/tst-setuid2.c
+++ b/nptl/tst-setuid2.c
@@ -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);
}