mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Fix Linux fcntl OFD locks on unsupported kernels
This patch make the OFD tests return unsupported if kernel does not support OFD locks (it was added on 3.15). Checked on a ia64-linux-gnu with Linux 3.14. * sysdeps/unix/sysv/linux/tst-ofdlocks.c: Return unsupported if kernel does not support OFD locks. * sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c: Likewise.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2018-07-27 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/tst-ofdlocks.c: Return unsupported if
|
||||||
|
kernel does not support OFD locks.
|
||||||
|
* sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c: Likewise.
|
||||||
|
|
||||||
2018-07-27 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
2018-07-27 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||||
|
|
||||||
* sysdeps/mach/hurd/Versions (libc): Make __access and
|
* sysdeps/mach/hurd/Versions (libc): Make __access and
|
||||||
|
@ -62,7 +62,12 @@ do_test (void)
|
|||||||
.l_start = (off64_t)INT32_MAX + 1024,
|
.l_start = (off64_t)INT32_MAX + 1024,
|
||||||
.l_len = 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
|
/* Open file description locks placed through the same open file description
|
||||||
(either by same file descriptor or a duplicated one created by fork,
|
(either by same file descriptor or a duplicated one created by fork,
|
||||||
|
@ -46,7 +46,12 @@ do_test (void)
|
|||||||
.l_start = (off64_t)INT32_MAX + 1024,
|
.l_start = (off64_t)INT32_MAX + 1024,
|
||||||
.l_len = 1024,
|
.l_len = 1024,
|
||||||
};
|
};
|
||||||
TEST_VERIFY_EXIT (fcntl64 (temp_fd, F_OFD_SETLKW, &lck64) == 0);
|
int ret = fcntl64 (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
|
/* Open file description locks placed through the same open file description
|
||||||
(either by same file descriptor or a duplicated one created by fork,
|
(either by same file descriptor or a duplicated one created by fork,
|
||||||
|
Reference in New Issue
Block a user