aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fcntl_test.cpp
diff options
context:
space:
mode:
authorSerban Constantinescu <serban.constantinescu@arm.com>2014-03-14 13:16:25 +0000
committerElliott Hughes <enh@google.com>2014-04-08 12:19:23 -0700
commit48501af98f3cdf0115a469ee8d773cf74c42958d (patch)
treeb26893fa81d808c0f93bf8fdf966e3210948b8c2 /tests/fcntl_test.cpp
parent0b0387c965894e235b72fa965191bf346270135d (diff)
downloadandroid_bionic-48501af98f3cdf0115a469ee8d773cf74c42958d.tar.gz
android_bionic-48501af98f3cdf0115a469ee8d773cf74c42958d.tar.bz2
android_bionic-48501af98f3cdf0115a469ee8d773cf74c42958d.zip
AArch64: Fix flock64 for LP64.
On LP64 systems F_GETLK64, F_SETLK64 and F_SETLKW64 definitions should map onto the F_GETLK, F_SETLK and F_SETLKW definitions, respectively. LP64 also doesn't have a struct flock64. Change-Id: Ibdfed9645d9e946999acd6efa8b96ea6238ed5bf Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Diffstat (limited to 'tests/fcntl_test.cpp')
-rw-r--r--tests/fcntl_test.cpp16
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);
+}