about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c')
-rw-r--r--sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c
index 03c4abfeff..aaf65af0db 100644
--- a/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c
+++ b/sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c
@@ -62,7 +62,12 @@ do_test (void)
     .l_start  = (off64_t)INT32_MAX + 1024,
     .l_len    = 1024,
   };
-  TEST_VERIFY_EXIT (fcntl (temp_fd, F_OFD_SETLKW, &lck64) == 0);
+  int ret = fcntl (temp_fd, F_OFD_SETLKW, &lck64);
+  if (ret == -1 && errno == EINVAL)
+    /* OFD locks are only available on Linux 3.15.  */
+    FAIL_UNSUPPORTED ("fcntl (F_OFD_SETLKW) not supported");
+
+  TEST_VERIFY_EXIT (ret == 0);
 
   /* Open file description locks placed through the same open file description
      (either by same file descriptor or a duplicated one created by fork,