diff options
-rw-r--r-- | build/has/io-uring-max-workers.c | 11 | ||||
-rw-r--r-- | build/header.mk | 1 | ||||
-rw-r--r-- | src/ioq.c | 3 |
3 files changed, 15 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 \ @@ -878,6 +878,7 @@ static int ioq_ring_init(struct ioq *ioq, struct ioq_thread *thread) { return -1; } +#if BFS_HAS_IO_URING_MAX_WORKERS // Limit the number of io_uring workers unsigned int values[] = { ioq->nthreads, // [IO_WQ_BOUND] @@ -886,6 +887,8 @@ static int ioq_ring_init(struct ioq *ioq, struct ioq_thread *thread) { io_uring_register_iowq_max_workers(&thread->ring, values); #endif +#endif // BFS_WITH_LIBURING + return 0; } |