* [PATCH v1] Add compatibility check for idtype_t
@ 2024-01-31 19:37 David Wei
2024-01-31 19:46 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: David Wei @ 2024-01-31 19:37 UTC (permalink / raw)
To: io-uring; +Cc: Jens Axboe, Pavel Begunkov
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] Add compatibility check for idtype_t
2024-01-31 19:37 [PATCH v1] Add compatibility check for idtype_t David Wei
@ 2024-01-31 19:46 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2024-01-31 19:46 UTC (permalink / raw)
To: io-uring, David Wei; +Cc: Pavel Begunkov
On Wed, 31 Jan 2024 11:37:50 -0800, David Wei wrote:
> 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.
>
>
> [...]
Applied, thanks!
[1/1] Add compatibility check for idtype_t
commit: b3addd05c912661b3a872382887a886d35ece536
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-31 19:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31 19:37 [PATCH v1] Add compatibility check for idtype_t David Wei
2024-01-31 19:46 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox