#!/bin/sh

# Check uid decoding.

. "${srcdir=.}/init.sh"

s="${uid_syscall_suffix-}"
w="${uid_t_size-}"

run_prog ./uid$s$w

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
match_awk "$LOG" "$srcdir"/uid.awk "$STRACE $args output mismatch" -v suffix="$s"

exit 0