From fb96b6370b88d9b7b07fa52ebf54706a8e8a110b Mon Sep 17 00:00:00 2001 From: Timotej Kapus Date: Thu, 19 Mar 2020 14:46:29 +0000 Subject: [posix-runtime] Simple GET/SET_LK model --- test/Runtime/POSIX/Fcntl.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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; } -- cgit 1.4.1