summaryrefslogtreecommitdiff
path: root/tests/fcntl64.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2018-06-01 01:46:06 +0000
committerDmitry V. Levin <ldv@altlinux.org>2018-06-01 01:46:06 +0000
commitdbbe61067c68968502564103f39d9d5b171d7f48 (patch)
tree46e94e29dbd6465205476991ac85da8efab47230 /tests/fcntl64.c
parentd476d264def4a433e0130a3e66053badaa08bf9f (diff)
downloadstrace-dbbe61067c68968502564103f39d9d5b171d7f48.tar.gz
tests: extend struct flock/flock64 decoding checks
* tests/fcntl-common.c (test_flock_einval, test_flock): Create struct_kernel_flock object using tail_alloc. (test_flock64_einval): Create struct_kernel_flock64 object using tail_alloc. * tests/fcntl64.c (test_flock64_lk64): Likewise.
Diffstat (limited to 'tests/fcntl64.c')
-rw-r--r--tests/fcntl64.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/fcntl64.c b/tests/fcntl64.c
index ac5a21799..965ba0a9c 100644
--- a/tests/fcntl64.c
+++ b/tests/fcntl64.c
@@ -41,11 +41,12 @@ test_flock64_lk64(void)
TEST_FLOCK64_EINVAL(F_SETLK64);
TEST_FLOCK64_EINVAL(F_SETLKW64);
- struct_kernel_flock64 fl = {
- .l_type = F_RDLCK,
- .l_len = FILE_LEN
- };
- long rc = invoke_test_syscall(0, F_SETLK64, &fl);
+ TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl);
+ memset(fl, 0, sizeof(*fl));
+ fl->l_type = F_RDLCK;
+ fl->l_len = FILE_LEN;
+
+ long rc = invoke_test_syscall(0, F_SETLK64, fl);
printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET"
", l_start=0, l_len=%d}) = %s\n",
TEST_SYSCALL_STR, FILE_LEN, errstr);
@@ -53,13 +54,13 @@ test_flock64_lk64(void)
if (rc)
return;
- invoke_test_syscall(0, F_GETLK64, &fl);
+ invoke_test_syscall(0, F_GETLK64, fl);
printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET"
", l_start=0, l_len=%d, l_pid=0}) = 0\n",
TEST_SYSCALL_STR, FILE_LEN);
- invoke_test_syscall(0, F_SETLK64, &fl);
- printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET"
+ invoke_test_syscall(0, F_SETLKW64, fl);
+ printf("%s(0, F_SETLKW64, {l_type=F_UNLCK, l_whence=SEEK_SET"
", l_start=0, l_len=%d}) = 0\n",
TEST_SYSCALL_STR, FILE_LEN);
}