Message ID | 87o74dfml8.fsf@oldenburg.str.redhat.com |
---|---|
State | New |
Headers | show |
Series | nptl: Fall back to setresuid32 in tst-setuid2 | expand |
On Sep 24 2024, Florian Weimer wrote: > On sparcv9-linux-gnu, __NR_setresuid is not defined. Use > __NR_setresuid32 instead. (Presumably, setresuid was once > the 16-bit variant of the system call.) __NR_setresuid32 should generally be preferred over __NR_setresuid. If both exist the latter is the obsolete 16-bit variant.
diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c index 33d4e39fff..205f1459a3 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_setresuid long ret = syscall (__NR_setresuid, 2001, 2002, 2003); +#else + /* Needed on sparcv9, which does not have the setresuid system call. */ + long ret = syscall (__NR_setresuid32, 2001, 2002, 2003); +#endif if (ret != 0) FAIL ("setresuid (2001, 2002, 2003): %ld", ret); }