aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Wei <dw@davidwei.uk>2024-01-31 11:37:50 -0800
committerJens Axboe <axboe@kernel.dk>2024-01-31 12:46:19 -0700
commitb3addd05c912661b3a872382887a886d35ece536 (patch)
tree5b18cdb8028f0698d68cd3055bf5ce37a587022d
parent5f8fafba1fcd049636db8bc1d768b842dacb8ac4 (diff)
downloadliburing-b3addd05c912661b3a872382887a886d35ece536.tar.gz
Add compatibility check for idtype_t
io_uring_prep_waitid() requires idtype_t, which is not always defined on all platforms. Add a check for the presence of idtype_t during configure, and if not found then add a definition in compat.h. Signed-off-by: David Wei <dw@davidwei.uk> Link: https://lore.kernel.org/r/20240131193750.3440432-1-dw@davidwei.uk Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rwxr-xr-xconfigure27
1 files changed, 27 insertions, 0 deletions
diff --git a/configure b/configure
index 9d29e20b..052920df 100755
--- a/configure
+++ b/configure
@@ -414,6 +414,22 @@ if compile_prog "" "" "futexv"; then
fi
print_config "futex waitv support" "$futexv"
+##########################################
+# Check idtype_t support
+has_idtype_t="no"
+cat > $TMPC << EOF
+#include <sys/wait.h>
+int main(void)
+{
+ idtype_t v;
+ return 0;
+}
+EOF
+if compile_prog "" "" "idtype_t"; then
+ has_idtype_t="yes"
+fi
+print_config "has_idtype_t" "$has_idtype_t"
+
#############################################################################
liburing_nolibc="no"
if test "$use_libc" != "yes"; then
@@ -592,6 +608,17 @@ struct futex_waitv {
EOF
fi
+
+if test "$has_idtype_t" != "yes"; then
+cat >> $compat_h << EOF
+typedef enum
+{
+ P_ALL, /* Wait for any child. */
+ P_PID, /* Wait for specified process. */
+ P_PGID /* Wait for members of process group. */
+} idtype_t;
+EOF
+fi
cat >> $compat_h << EOF
#endif
EOF