tests: add faccessat.test
* tests/faccessat.c: New file. * tests/faccessat.test: New test. * tests/.gitignore: Add faccessat. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add faccessat.test.
This commit is contained in:
parent
8346e63e43
commit
e2975b61b3
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -30,6 +30,7 @@ execve
|
||||
execve-v
|
||||
execveat
|
||||
execveat-v
|
||||
faccessat
|
||||
fanotify_mark
|
||||
fchmod
|
||||
fcntl
|
||||
|
@ -81,6 +81,7 @@ check_PROGRAMS = \
|
||||
execve-v \
|
||||
execveat \
|
||||
execveat-v \
|
||||
faccessat \
|
||||
fanotify_mark \
|
||||
fchmod \
|
||||
fcntl \
|
||||
@ -254,6 +255,7 @@ DECODER_TESTS = \
|
||||
execve-v.test \
|
||||
execveat.test \
|
||||
execveat-v.test \
|
||||
faccessat.test \
|
||||
fanotify_mark.test \
|
||||
fchmod.test \
|
||||
fcntl.test \
|
||||
|
29
tests/faccessat.c
Normal file
29
tests/faccessat.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "tests.h"
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#ifdef __NR_faccessat
|
||||
|
||||
# include <errno.h>
|
||||
# include <stdio.h>
|
||||
# include <unistd.h>
|
||||
|
||||
# define TMP_FILE "faccessat_tmpfile"
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
const long int fd = (long int) 0xdeadbeefffffffff;
|
||||
int rc = syscall(__NR_faccessat, fd, TMP_FILE, F_OK);
|
||||
printf("faccessat(%d, \"%s\", F_OK) = %d %s (%m)\n",
|
||||
(int) fd, TMP_FILE, rc,
|
||||
errno == ENOSYS ? "ENOSYS" : "EBADF");
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
SKIP_MAIN_UNDEFINED("__NR_faccessat")
|
||||
|
||||
#endif
|
11
tests/faccessat.test
Executable file
11
tests/faccessat.test
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check faccessat syscall decoding.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
|
||||
run_prog > /dev/null
|
||||
OUT="$LOG.out"
|
||||
run_strace -efaccessat $args > "$OUT"
|
||||
match_diff "$LOG" "$OUT"
|
||||
rm -f "$OUT"
|
Loading…
x
Reference in New Issue
Block a user