about summary refs log tree commit diff homepage
path: root/test
diff options
context:
space:
mode:
authorTimotej Kapus <tk1713@ic.ac.uk>2020-03-19 14:46:29 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-03-22 14:12:02 +0000
commitfb96b6370b88d9b7b07fa52ebf54706a8e8a110b (patch)
tree5319580caabd4046849ef34cd19a4e74d7f4d6c9 /test
parent391eb4973da52e7ef5b99d846852d557006b949c (diff)
downloadklee-fb96b6370b88d9b7b07fa52ebf54706a8e8a110b.tar.gz
[posix-runtime] Simple GET/SET_LK model
Diffstat (limited to 'test')
-rw-r--r--test/Runtime/POSIX/Fcntl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Runtime/POSIX/Fcntl.c b/test/Runtime/POSIX/Fcntl.c
index 41aeb326..53246a15 100644
--- a/test/Runtime/POSIX/Fcntl.c
+++ b/test/Runtime/POSIX/Fcntl.c
@@ -14,5 +14,12 @@ int main(int argc, char **argv) {
   assert(fcntl(fd, F_SETFD, FD_CLOEXEC, 1) == 0);
   assert((fcntl(fd, F_GETFD) & FD_CLOEXEC) != 0);
 
+  struct flock lck;
+  assert(fcntl(fd, F_GETLK, &lck) == 0);
+  assert(lck.l_type == F_UNLCK);
+  lck.l_type = F_RDLCK;
+  assert(fcntl(fd, F_SETLK, &lck) == 0);
+  lck.l_type = F_UNLCK;
+  assert(fcntl(fd, F_SETLK, &lck) == 0);
   return 0;
 }