tests: add mkdir.test
* tests/mkdir.c: New file. * tests/mkdir.test: New test. * tests/.gitignore: Add mkdir. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add mkdir.test.
This commit is contained in:
parent
8bfe0d5e22
commit
5c1776fe00
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -99,6 +99,7 @@ lstat64
|
||||
membarrier
|
||||
memfd_create
|
||||
mincore
|
||||
mkdir
|
||||
mkdirat
|
||||
mknod
|
||||
mlock2
|
||||
|
@ -150,6 +150,7 @@ check_PROGRAMS = \
|
||||
membarrier \
|
||||
memfd_create \
|
||||
mincore \
|
||||
mkdir \
|
||||
mkdirat \
|
||||
mknod \
|
||||
mlock2 \
|
||||
@ -395,6 +396,7 @@ DECODER_TESTS = \
|
||||
membarrier.test \
|
||||
memfd_create.test \
|
||||
mincore.test \
|
||||
mkdir.test \
|
||||
mkdirat.test \
|
||||
mknod.test \
|
||||
mlock2.test \
|
||||
|
27
tests/mkdir.c
Normal file
27
tests/mkdir.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include "tests.h"
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#ifdef __NR_mkdir
|
||||
|
||||
# include <errno.h>
|
||||
# include <stdio.h>
|
||||
# include <unistd.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
static const char sample[] = "mkdir";
|
||||
|
||||
long rc = syscall(__NR_mkdir, sample, 0600);
|
||||
printf("mkdir(\"%s\", 0600) = %ld %s (%m)\n",
|
||||
sample, rc, errno == ENOSYS ? "ENOSYS" : "EEXIST");
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
SKIP_MAIN_UNDEFINED("__NR_mkdir")
|
||||
|
||||
#endif
|
6
tests/mkdir.test
Executable file
6
tests/mkdir.test
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check mkdir syscall decoding.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
run_strace_match_diff -a21
|
Loading…
Reference in New Issue
Block a user