Make the test work on alpha that has getxuid syscall instead of getuid.
* tests/uid.awk (BEGIN): Update getuid regexp to match both getuid
and getxuid syscalls.
* tests/uid.c (main): Allow __NR_getxuid as an alternative
to __NR_getuid.
* tests/uid.test: If getuid syscall is not available, probe for
getxuid syscall.
BEGIN {
r_uint = "(0|[1-9][0-9]*)"
- regexp = "^getuid" suffix "\\(\\)[[:space:]]+= " r_uint "$"
+ regexp = "^getx?uid" suffix "\\(\\)[[:space:]]+= " r_uint "$"
expected = "getuid"
fail = 0
}
int
main(void)
{
-#if defined(__NR_getuid) \
+#if (defined __NR_getuid || defined __NR_getxuid) \
&& defined(__NR_setuid) \
&& defined(__NR_getresuid) \
&& defined(__NR_setreuid) \
int size;
int *list = 0;
+#ifndef __NR_getuid
+# define __NR_getuid __NR_getxuid
+#endif
uid = syscall(__NR_getuid);
assert(syscall(__NR_setuid, uid) == 0);
{
run_prog ./uid$s$w
-syscalls="getuid$s,setuid$s,getresuid$s,setreuid$s,setresuid$s,fchown$s,getgroups$s"
+syscalls=
+for n in "getuid$s" "getxuid$s"; do
+ if $STRACE -e "$n" -h > /dev/null; then
+ syscalls="$n"
+ break
+ fi
+done
+test -n "$syscalls" ||
+ fail_ "neither getuid$s nor getxuid$s is supported on this architecture"
+
+syscalls="$syscalls,setuid$s,getresuid$s,setreuid$s,setresuid$s,fchown$s,getgroups$s"
run_strace -e trace="$syscalls" $args
AWK=gawk