Linux: Add FUTEX_LOCK_PI2
authorKurt Kanzenbach <kurt@linutronix.de>
Fri, 25 Jun 2021 08:10:59 +0000 (10:10 +0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 1 Oct 2021 11:09:13 +0000 (08:09 -0300)
Linux v5.14.0 introduced a new futex operation called FUTEX_LOCK_PI2.

This kernel feature can be used to implement
pthread_mutex_clocklock(MONOTONIC)/PI.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/kernel-features.h

index 3930e14322494d53c1d16d5085c5dedca3057551..ffb6af196b81c3ed2948b20462b0a401b23cbba4 100644 (file)
 # define __ASSUME_FACCESSAT2 0
 #endif
 
+/* The FUTEX_LOCK_PI2 operation was introduced across all architectures in Linux
+   5.14.  */
+#if __LINUX_KERNEL_VERSION >= 0x050e00
+# define __ASSUME_FUTEX_LOCK_PI2 1
+#else
+# define __ASSUME_FUTEX_LOCK_PI2 0
+#endif
+
 #endif /* kernel-features.h */