diff options
Diffstat (limited to 'tests/fcntl_test.cpp')
-rw-r--r-- | tests/fcntl_test.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/fcntl_test.cpp b/tests/fcntl_test.cpp index 4aac46823..725ac4a4c 100644 --- a/tests/fcntl_test.cpp +++ b/tests/fcntl_test.cpp @@ -116,3 +116,19 @@ TEST(fcntl, fallocate) { ASSERT_EQ(0, fstat(tf.fd, &sb)); ASSERT_EQ(4, sb.st_size); } + +TEST(fcntl, f_getlk64) { + int fd = open64("/proc/version", O_RDONLY); + ASSERT_TRUE(fd != -1); + + struct flock64 check_lock; + check_lock.l_type = F_WRLCK; + check_lock.l_start = 0; + check_lock.l_whence = SEEK_SET; + check_lock.l_len = 0; + + int rc = fcntl(fd, F_GETLK64, &check_lock); + ASSERT_EQ(0, rc); + + close(fd); +} |