public inbox for [email protected]
 help / color / mirror / Atom feed
From: David Wei <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, Pavel Begunkov <[email protected]>
Subject: [PATCH v1] Add compatibility check for idtype_t
Date: Wed, 31 Jan 2024 11:37:50 -0800	[thread overview]
Message-ID: <[email protected]> (raw)

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 <[email protected]>
---
 configure | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/configure b/configure
index 9d29e20..052920d 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
@@ -590,6 +606,17 @@ struct futex_waitv {
 	uint32_t	__reserved;
 };
 
+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
-- 
2.39.3


             reply	other threads:[~2024-01-31 19:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 19:37 David Wei [this message]
2024-01-31 19:46 ` [PATCH v1] Add compatibility check for idtype_t Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox