summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-11-11 09:00:11 -0500
committerTavian Barnes <tavianator@tavianator.com>2024-11-11 09:09:35 -0500
commitdcbcf7f775c75e7d5142fed571967a5e57e89fed (patch)
tree513e9ce1fe2233c5befc1c8b40fac298711e89bc /build
parentd09b784e395554cb67ec91e70544a052fe60a276 (diff)
downloadbfs-dcbcf7f775c75e7d5142fed571967a5e57e89fed.tar.xz
ioq: Check for io_uring_register_iowq_max_workers() before using it
This allows us to build against liburing as old as version 2.0, which is apparently shipped by the latest Amazon Linux distribution. Fixes: https://github.com/tavianator/bfs/issues/147
Diffstat (limited to 'build')
-rw-r--r--build/has/io-uring-max-workers.c11
-rw-r--r--build/header.mk1
2 files changed, 12 insertions, 0 deletions
diff --git a/build/has/io-uring-max-workers.c b/build/has/io-uring-max-workers.c
new file mode 100644
index 0000000..34ab5b7
--- /dev/null
+++ b/build/has/io-uring-max-workers.c
@@ -0,0 +1,11 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <liburing.h>
+
+int main(void) {
+ struct io_uring ring;
+ io_uring_queue_init(1, &ring, 0);
+ unsigned int values[] = {0, 0};
+ return io_uring_register_iowq_max_workers(&ring, values);
+}
diff --git a/build/header.mk b/build/header.mk
index e9f1abc..f940e52 100644
--- a/build/header.mk
+++ b/build/header.mk
@@ -33,6 +33,7 @@ HEADERS := \
gen/has/getmntinfo.h \
gen/has/getprogname-gnu.h \
gen/has/getprogname.h \
+ gen/has/io-uring-max-workers.h \
gen/has/pipe2.h \
gen/has/posix-getdents.h \
gen/has/posix-spawn-addfchdir-np.h \