polyphony 0.93 → 0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -2
- data/.gitignore +3 -3
- data/CHANGELOG.md +14 -0
- data/docs/api-reference/fiber.md +2 -2
- data/docs/api-reference/object.md +3 -3
- data/docs/main-concepts/exception-handling.md +2 -2
- data/examples/pipes/echo_server.rb +1 -1
- data/examples/pipes/http_server.rb +33 -0
- data/ext/polyphony/backend_common.c +53 -8
- data/ext/polyphony/backend_common.h +21 -13
- data/ext/polyphony/backend_io_uring.c +85 -147
- data/ext/polyphony/backend_libev.c +58 -89
- data/ext/polyphony/event.c +1 -1
- data/ext/polyphony/extconf.rb +7 -5
- data/ext/polyphony/fiber.c +5 -13
- data/ext/polyphony/io_extensions.c +68 -68
- data/ext/polyphony/pipe.c +1 -1
- data/ext/polyphony/polyphony.c +23 -23
- data/ext/polyphony/polyphony.h +0 -9
- data/ext/polyphony/polyphony_ext.c +1 -1
- data/ext/polyphony/queue.c +1 -1
- data/ext/polyphony/ring_buffer.c +1 -0
- data/ext/polyphony/socket_extensions.c +1 -1
- data/ext/polyphony/thread.c +1 -1
- data/lib/polyphony/extensions/enumerator.rb +16 -0
- data/lib/polyphony/extensions/socket.rb +2 -0
- data/lib/polyphony/extensions.rb +1 -0
- data/lib/polyphony/version.rb +1 -1
- data/polyphony.gemspec +2 -2
- data/test/test_backend.rb +5 -1
- data/test/test_enumerator.rb +46 -0
- data/test/test_global_api.rb +1 -1
- data/test/test_io.rb +241 -216
- data/test/test_socket.rb +1 -1
- data/test/test_thread_pool.rb +3 -3
- data/vendor/liburing/.github/workflows/build.yml +51 -5
- data/vendor/liburing/.github/workflows/shellcheck.yml +1 -1
- data/vendor/liburing/.gitignore +6 -123
- data/vendor/liburing/CHANGELOG +35 -0
- data/vendor/liburing/CITATION.cff +11 -0
- data/vendor/liburing/LICENSE +16 -3
- data/vendor/liburing/Makefile +3 -1
- data/vendor/liburing/Makefile.common +1 -0
- data/vendor/liburing/README +14 -2
- data/vendor/liburing/SECURITY.md +6 -0
- data/vendor/liburing/configure +16 -15
- data/vendor/liburing/examples/Makefile +4 -1
- data/vendor/liburing/examples/io_uring-udp.c +395 -0
- data/vendor/liburing/examples/poll-bench.c +101 -0
- data/vendor/liburing/examples/send-zerocopy.c +339 -0
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/man/io_uring.7 +38 -11
- data/vendor/liburing/man/io_uring_buf_ring_add.3 +53 -0
- data/vendor/liburing/man/io_uring_buf_ring_advance.3 +31 -0
- data/vendor/liburing/man/io_uring_buf_ring_cq_advance.3 +41 -0
- data/vendor/liburing/man/io_uring_buf_ring_init.3 +30 -0
- data/vendor/liburing/man/io_uring_buf_ring_mask.3 +27 -0
- data/vendor/liburing/man/io_uring_cq_advance.3 +29 -15
- data/vendor/liburing/man/io_uring_cq_has_overflow.3 +25 -0
- data/vendor/liburing/man/io_uring_cq_ready.3 +9 -8
- data/vendor/liburing/man/io_uring_cqe_get_data.3 +32 -13
- data/vendor/liburing/man/io_uring_cqe_get_data64.3 +1 -0
- data/vendor/liburing/man/io_uring_cqe_seen.3 +22 -12
- data/vendor/liburing/man/io_uring_enter.2 +249 -32
- data/vendor/liburing/man/io_uring_enter2.2 +1 -0
- data/vendor/liburing/man/io_uring_free_probe.3 +11 -8
- data/vendor/liburing/man/io_uring_get_events.3 +33 -0
- data/vendor/liburing/man/io_uring_get_probe.3 +9 -8
- data/vendor/liburing/man/io_uring_get_sqe.3 +29 -10
- data/vendor/liburing/man/io_uring_opcode_supported.3 +11 -10
- data/vendor/liburing/man/io_uring_peek_cqe.3 +38 -0
- data/vendor/liburing/man/io_uring_prep_accept.3 +197 -0
- data/vendor/liburing/man/io_uring_prep_accept_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_cancel.3 +118 -0
- data/vendor/liburing/man/io_uring_prep_cancel64.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_close.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_close_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_connect.3 +66 -0
- data/vendor/liburing/man/io_uring_prep_fadvise.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_fallocate.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_files_update.3 +92 -0
- data/vendor/liburing/man/io_uring_prep_fsync.3 +70 -0
- data/vendor/liburing/man/io_uring_prep_link.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_linkat.3 +91 -0
- data/vendor/liburing/man/io_uring_prep_madvise.3 +56 -0
- data/vendor/liburing/man/io_uring_prep_mkdir.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_mkdirat.3 +83 -0
- data/vendor/liburing/man/io_uring_prep_msg_ring.3 +39 -25
- data/vendor/liburing/man/io_uring_prep_multishot_accept.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_multishot_accept_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_nop.3 +28 -0
- data/vendor/liburing/man/io_uring_prep_openat.3 +117 -0
- data/vendor/liburing/man/io_uring_prep_openat2.3 +117 -0
- data/vendor/liburing/man/io_uring_prep_openat2_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_openat_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_poll_add.3 +72 -0
- data/vendor/liburing/man/io_uring_prep_poll_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_poll_remove.3 +55 -0
- data/vendor/liburing/man/io_uring_prep_poll_update.3 +89 -0
- data/vendor/liburing/man/io_uring_prep_provide_buffers.3 +131 -0
- data/vendor/liburing/man/io_uring_prep_read.3 +33 -14
- data/vendor/liburing/man/io_uring_prep_read_fixed.3 +39 -21
- data/vendor/liburing/man/io_uring_prep_readv.3 +49 -15
- data/vendor/liburing/man/io_uring_prep_readv2.3 +49 -17
- data/vendor/liburing/man/io_uring_prep_recv.3 +105 -0
- data/vendor/liburing/man/io_uring_prep_recv_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_recvmsg.3 +124 -0
- data/vendor/liburing/man/io_uring_prep_recvmsg_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_remove_buffers.3 +52 -0
- data/vendor/liburing/man/io_uring_prep_rename.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_renameat.3 +96 -0
- data/vendor/liburing/man/io_uring_prep_send.3 +57 -0
- data/vendor/liburing/man/io_uring_prep_send_zc.3 +64 -0
- data/vendor/liburing/man/io_uring_prep_sendmsg.3 +69 -0
- data/vendor/liburing/man/io_uring_prep_shutdown.3 +53 -0
- data/vendor/liburing/man/io_uring_prep_socket.3 +118 -0
- data/vendor/liburing/man/io_uring_prep_socket_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_socket_direct_alloc.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_splice.3 +80 -0
- data/vendor/liburing/man/io_uring_prep_statx.3 +74 -0
- data/vendor/liburing/man/io_uring_prep_symlink.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_symlinkat.3 +85 -0
- data/vendor/liburing/man/io_uring_prep_sync_file_range.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_tee.3 +74 -0
- data/vendor/liburing/man/io_uring_prep_timeout.3 +95 -0
- data/vendor/liburing/man/io_uring_prep_timeout_remove.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_timeout_update.3 +98 -0
- data/vendor/liburing/man/io_uring_prep_unlink.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_unlinkat.3 +82 -0
- data/vendor/liburing/man/io_uring_prep_write.3 +32 -15
- data/vendor/liburing/man/io_uring_prep_write_fixed.3 +39 -21
- data/vendor/liburing/man/io_uring_prep_writev.3 +50 -16
- data/vendor/liburing/man/io_uring_prep_writev2.3 +50 -17
- data/vendor/liburing/man/io_uring_queue_exit.3 +3 -4
- data/vendor/liburing/man/io_uring_queue_init.3 +58 -13
- data/vendor/liburing/man/io_uring_queue_init_params.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_cmsg_firsthdr.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_cmsg_nexthdr.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_name.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_out.3 +78 -0
- data/vendor/liburing/man/io_uring_recvmsg_payload.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_payload_length.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_validate.3 +1 -0
- data/vendor/liburing/man/io_uring_register.2 +153 -13
- data/vendor/liburing/man/io_uring_register_buf_ring.3 +140 -0
- data/vendor/liburing/man/io_uring_register_buffers.3 +32 -12
- data/vendor/liburing/man/io_uring_register_eventfd.3 +51 -0
- data/vendor/liburing/man/io_uring_register_eventfd_async.3 +1 -0
- data/vendor/liburing/man/io_uring_register_file_alloc_range.3 +52 -0
- data/vendor/liburing/man/io_uring_register_files.3 +33 -11
- data/vendor/liburing/man/io_uring_register_files_sparse.3 +1 -0
- data/vendor/liburing/man/io_uring_register_iowq_aff.3 +61 -0
- data/vendor/liburing/man/io_uring_register_iowq_max_workers.3 +71 -0
- data/vendor/liburing/man/io_uring_register_ring_fd.3 +49 -0
- data/vendor/liburing/man/io_uring_register_sync_cancel.3 +71 -0
- data/vendor/liburing/man/io_uring_setup.2 +119 -13
- data/vendor/liburing/man/io_uring_sq_ready.3 +14 -8
- data/vendor/liburing/man/io_uring_sq_space_left.3 +9 -9
- data/vendor/liburing/man/io_uring_sqe_set_data.3 +29 -11
- data/vendor/liburing/man/io_uring_sqe_set_data64.3 +1 -0
- data/vendor/liburing/man/io_uring_sqe_set_flags.3 +38 -11
- data/vendor/liburing/man/io_uring_sqring_wait.3 +13 -9
- data/vendor/liburing/man/io_uring_submit.3 +29 -12
- data/vendor/liburing/man/io_uring_submit_and_get_events.3 +31 -0
- data/vendor/liburing/man/io_uring_submit_and_wait.3 +16 -12
- data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +30 -23
- data/vendor/liburing/man/io_uring_unregister_buf_ring.3 +30 -0
- data/vendor/liburing/man/io_uring_unregister_buffers.3 +11 -10
- data/vendor/liburing/man/io_uring_unregister_eventfd.3 +1 -0
- data/vendor/liburing/man/io_uring_unregister_files.3 +11 -10
- data/vendor/liburing/man/io_uring_unregister_iowq_aff.3 +1 -0
- data/vendor/liburing/man/io_uring_unregister_ring_fd.3 +32 -0
- data/vendor/liburing/man/io_uring_wait_cqe.3 +19 -12
- data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +21 -14
- data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +27 -13
- data/vendor/liburing/man/io_uring_wait_cqes.3 +24 -14
- data/vendor/liburing/src/Makefile +8 -7
- data/vendor/liburing/src/arch/aarch64/lib.h +48 -0
- data/vendor/liburing/src/arch/aarch64/syscall.h +0 -4
- data/vendor/liburing/src/arch/generic/lib.h +0 -4
- data/vendor/liburing/src/arch/generic/syscall.h +29 -16
- data/vendor/liburing/src/arch/syscall-defs.h +41 -14
- data/vendor/liburing/src/arch/x86/lib.h +0 -21
- data/vendor/liburing/src/arch/x86/syscall.h +146 -10
- data/vendor/liburing/src/include/liburing/io_uring.h +245 -5
- data/vendor/liburing/src/include/liburing.h +468 -35
- data/vendor/liburing/src/int_flags.h +1 -0
- data/vendor/liburing/src/lib.h +20 -16
- data/vendor/liburing/src/liburing.map +16 -0
- data/vendor/liburing/src/nolibc.c +1 -1
- data/vendor/liburing/src/queue.c +87 -55
- data/vendor/liburing/src/register.c +129 -53
- data/vendor/liburing/src/setup.c +65 -28
- data/vendor/liburing/src/syscall.c +14 -32
- data/vendor/liburing/src/syscall.h +12 -64
- data/vendor/liburing/test/{232c93d07b74-test.c → 232c93d07b74.c} +8 -9
- data/vendor/liburing/test/{35fa71a030ca-test.c → 35fa71a030ca.c} +4 -4
- data/vendor/liburing/test/{500f9fbadef8-test.c → 500f9fbadef8.c} +7 -7
- data/vendor/liburing/test/{7ad0e4b2f83c-test.c → 7ad0e4b2f83c.c} +8 -7
- data/vendor/liburing/test/{8a9973408177-test.c → 8a9973408177.c} +4 -3
- data/vendor/liburing/test/{917257daa0fe-test.c → 917257daa0fe.c} +3 -2
- data/vendor/liburing/test/Makefile +60 -62
- data/vendor/liburing/test/{a0908ae19763-test.c → a0908ae19763.c} +3 -2
- data/vendor/liburing/test/{a4c0b3decb33-test.c → a4c0b3decb33.c} +3 -2
- data/vendor/liburing/test/accept-link.c +5 -4
- data/vendor/liburing/test/accept-reuse.c +17 -16
- data/vendor/liburing/test/accept-test.c +14 -10
- data/vendor/liburing/test/accept.c +529 -107
- data/vendor/liburing/test/across-fork.c +7 -6
- data/vendor/liburing/test/{b19062a56726-test.c → b19062a56726.c} +3 -2
- data/vendor/liburing/test/{b5837bd5311d-test.c → b5837bd5311d.c} +10 -9
- data/vendor/liburing/test/buf-ring.c +420 -0
- data/vendor/liburing/test/{ce593a6c480a-test.c → ce593a6c480a.c} +15 -12
- data/vendor/liburing/test/connect.c +8 -7
- data/vendor/liburing/test/cq-full.c +5 -4
- data/vendor/liburing/test/cq-overflow.c +242 -12
- data/vendor/liburing/test/cq-peek-batch.c +5 -4
- data/vendor/liburing/test/cq-ready.c +5 -4
- data/vendor/liburing/test/cq-size.c +5 -4
- data/vendor/liburing/test/{d4ae271dfaae-test.c → d4ae271dfaae.c} +2 -2
- data/vendor/liburing/test/{d77a67ed5f27-test.c → d77a67ed5f27.c} +6 -6
- data/vendor/liburing/test/defer-taskrun.c +336 -0
- data/vendor/liburing/test/defer.c +26 -14
- data/vendor/liburing/test/double-poll-crash.c +15 -5
- data/vendor/liburing/test/drop-submit.c +5 -3
- data/vendor/liburing/test/{eeed8b54e0df-test.c → eeed8b54e0df.c} +7 -6
- data/vendor/liburing/test/empty-eownerdead.c +4 -4
- data/vendor/liburing/test/eventfd-disable.c +48 -20
- data/vendor/liburing/test/eventfd-reg.c +10 -9
- data/vendor/liburing/test/eventfd-ring.c +13 -12
- data/vendor/liburing/test/eventfd.c +13 -12
- data/vendor/liburing/test/exit-no-cleanup.c +1 -1
- data/vendor/liburing/test/fadvise.c +3 -3
- data/vendor/liburing/test/fallocate.c +16 -9
- data/vendor/liburing/test/{fc2a85cb02ef-test.c → fc2a85cb02ef.c} +4 -3
- data/vendor/liburing/test/fd-pass.c +187 -0
- data/vendor/liburing/test/file-register.c +302 -36
- data/vendor/liburing/test/file-update.c +62 -4
- data/vendor/liburing/test/file-verify.c +6 -2
- data/vendor/liburing/test/files-exit-hang-poll.c +11 -25
- data/vendor/liburing/test/files-exit-hang-timeout.c +13 -10
- data/vendor/liburing/test/fixed-buf-iter.c +115 -0
- data/vendor/liburing/test/fixed-link.c +10 -10
- data/vendor/liburing/test/fixed-reuse.c +160 -0
- data/vendor/liburing/test/fpos.c +6 -3
- data/vendor/liburing/test/fsync.c +3 -3
- data/vendor/liburing/test/hardlink.c +10 -6
- data/vendor/liburing/test/helpers.c +137 -4
- data/vendor/liburing/test/helpers.h +27 -0
- data/vendor/liburing/test/io-cancel.c +16 -11
- data/vendor/liburing/test/io_uring_enter.c +46 -81
- data/vendor/liburing/test/io_uring_passthrough.c +451 -0
- data/vendor/liburing/test/io_uring_register.c +59 -229
- data/vendor/liburing/test/io_uring_setup.c +24 -29
- data/vendor/liburing/test/iopoll-leak.c +85 -0
- data/vendor/liburing/test/iopoll.c +16 -9
- data/vendor/liburing/test/lfs-openat-write.c +3 -1
- data/vendor/liburing/test/link-timeout.c +4 -3
- data/vendor/liburing/test/link.c +8 -7
- data/vendor/liburing/test/madvise.c +2 -2
- data/vendor/liburing/test/mkdir.c +9 -5
- data/vendor/liburing/test/msg-ring.c +46 -20
- data/vendor/liburing/test/multicqes_drain.c +51 -12
- data/vendor/liburing/test/nolibc.c +60 -0
- data/vendor/liburing/test/nop.c +78 -16
- data/vendor/liburing/test/nvme.h +168 -0
- data/vendor/liburing/test/open-direct-link.c +188 -0
- data/vendor/liburing/test/open-direct-pick.c +180 -0
- data/vendor/liburing/test/openat2.c +3 -3
- data/vendor/liburing/test/poll-cancel-all.c +472 -0
- data/vendor/liburing/test/poll-link.c +9 -18
- data/vendor/liburing/test/poll-mshot-overflow.c +162 -0
- data/vendor/liburing/test/poll-mshot-update.c +83 -33
- data/vendor/liburing/test/pollfree.c +2 -2
- data/vendor/liburing/test/read-before-exit.c +112 -0
- data/vendor/liburing/test/read-write.c +83 -1
- data/vendor/liburing/test/recv-msgall-stream.c +398 -0
- data/vendor/liburing/test/recv-msgall.c +265 -0
- data/vendor/liburing/test/recv-multishot.c +505 -0
- data/vendor/liburing/test/rename.c +2 -5
- data/vendor/liburing/test/ring-leak.c +97 -0
- data/vendor/liburing/test/ringbuf-read.c +200 -0
- data/vendor/liburing/test/rsrc_tags.c +25 -13
- data/vendor/liburing/test/runtests-quiet.sh +11 -0
- data/vendor/liburing/test/runtests.sh +18 -20
- data/vendor/liburing/test/rw_merge_test.c +3 -2
- data/vendor/liburing/test/send-zerocopy.c +684 -0
- data/vendor/liburing/test/send_recv.c +49 -2
- data/vendor/liburing/test/send_recvmsg.c +165 -55
- data/vendor/liburing/test/shutdown.c +3 -4
- data/vendor/liburing/test/sigfd-deadlock.c +22 -8
- data/vendor/liburing/test/single-issuer.c +171 -0
- data/vendor/liburing/test/socket-rw-eagain.c +2 -12
- data/vendor/liburing/test/socket-rw-offset.c +2 -11
- data/vendor/liburing/test/socket-rw.c +2 -11
- data/vendor/liburing/test/socket.c +409 -0
- data/vendor/liburing/test/sq-poll-dup.c +1 -1
- data/vendor/liburing/test/sq-poll-share.c +1 -1
- data/vendor/liburing/test/statx.c +2 -2
- data/vendor/liburing/test/submit-and-wait.c +108 -0
- data/vendor/liburing/test/submit-link-fail.c +5 -3
- data/vendor/liburing/test/submit-reuse.c +0 -2
- data/vendor/liburing/test/sync-cancel.c +235 -0
- data/vendor/liburing/test/test.h +35 -0
- data/vendor/liburing/test/timeout-overflow.c +11 -11
- data/vendor/liburing/test/timeout.c +7 -7
- data/vendor/liburing/test/tty-write-dpoll.c +60 -0
- data/vendor/liburing/test/unlink.c +1 -1
- data/vendor/liburing/test/xattr.c +425 -0
- metadata +148 -26
- data/Gemfile.lock +0 -82
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
|
|
2
|
+
.\"
|
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
|
+
.\"
|
|
5
|
+
.TH io_uring_unregister_buf_ring 3 "May 18, 2022" "liburing-2.2" "liburing Manual"
|
|
6
|
+
.SH NAME
|
|
7
|
+
io_uring_unregister_buf_ring \- unregister a previously registered buffer ring
|
|
8
|
+
.SH SYNOPSIS
|
|
9
|
+
.nf
|
|
10
|
+
.B #include <liburing.h>
|
|
11
|
+
.PP
|
|
12
|
+
.BI "int io_uring_unregister_buf_ring(struct io_uring *" ring ",
|
|
13
|
+
.BI " int " bgid ");"
|
|
14
|
+
.BI "
|
|
15
|
+
.fi
|
|
16
|
+
.SH DESCRIPTION
|
|
17
|
+
.PP
|
|
18
|
+
The
|
|
19
|
+
.BR io_uring_unregister_buf_ring (3)
|
|
20
|
+
function unregisters a previously registered shared buffer ring indicated by
|
|
21
|
+
.IR bgid .
|
|
22
|
+
|
|
23
|
+
.SH RETURN VALUE
|
|
24
|
+
On success
|
|
25
|
+
.BR io_uring_unregister_buf_ring (3)
|
|
26
|
+
returns 0. On failure it returns
|
|
27
|
+
.BR -errno .
|
|
28
|
+
.SH SEE ALSO
|
|
29
|
+
.BR io_uring_register_buf_ring (3),
|
|
30
|
+
.BR io_uring_buf_ring_free (3)
|
|
@@ -4,23 +4,24 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_unregister_buffers 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_unregister_buffers
|
|
8
|
-
.fi
|
|
7
|
+
io_uring_unregister_buffers \- unregister buffers for fixed buffer operations
|
|
9
8
|
.SH SYNOPSIS
|
|
10
9
|
.nf
|
|
11
|
-
.
|
|
12
|
-
.PP
|
|
13
|
-
.BI "int io_uring_unregister_buffers(struct io_uring *ring)"
|
|
10
|
+
.B #include <liburing.h>
|
|
14
11
|
.PP
|
|
12
|
+
.BI "int io_uring_unregister_buffers(struct io_uring *" ring ");"
|
|
13
|
+
.fi
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
The
|
|
17
|
+
.BR io_uring_unregister_buffers (3)
|
|
18
|
+
function unregisters the fixed buffers previously registered to the
|
|
19
|
+
.IR ring .
|
|
20
20
|
|
|
21
21
|
.SH RETURN VALUE
|
|
22
22
|
On success
|
|
23
23
|
.BR io_uring_unregister_buffers (3)
|
|
24
|
-
returns 0. On failure it returns
|
|
24
|
+
returns 0. On failure it returns
|
|
25
|
+
.BR -errno .
|
|
25
26
|
.SH SEE ALSO
|
|
26
|
-
.BR io_uring_register_buffers (3)
|
|
27
|
+
.BR io_uring_register_buffers (3)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
io_uring_register_eventfd.3
|
|
@@ -4,23 +4,24 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_unregister_files 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_unregister_files
|
|
8
|
-
.fi
|
|
7
|
+
io_uring_unregister_files \- unregister file descriptors
|
|
9
8
|
.SH SYNOPSIS
|
|
10
9
|
.nf
|
|
11
|
-
.
|
|
12
|
-
.PP
|
|
13
|
-
.BI "int io_uring_unregister_files(struct io_uring *ring)"
|
|
10
|
+
.B #include <liburing.h>
|
|
14
11
|
.PP
|
|
12
|
+
.BI "int io_uring_unregister_files(struct io_uring *" ring ");"
|
|
13
|
+
.fi
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
The
|
|
17
|
+
.BR io_uring_unregister_files (3)
|
|
18
|
+
function unregisters the file descriptors previously registered to the
|
|
19
|
+
.IR ring .
|
|
20
20
|
|
|
21
21
|
.SH RETURN VALUE
|
|
22
22
|
On success
|
|
23
23
|
.BR io_uring_unregister_files (3)
|
|
24
|
-
returns 0. On failure it returns
|
|
24
|
+
returns 0. On failure it returns
|
|
25
|
+
.BR -errno .
|
|
25
26
|
.SH SEE ALSO
|
|
26
|
-
.BR io_uring_register_files (3)
|
|
27
|
+
.BR io_uring_register_files (3)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
io_uring_register_iowq_aff.3
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
|
|
2
|
+
.\"
|
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
|
+
.\"
|
|
5
|
+
.TH io_uring_unregister_ring_fd 3 "March 11, 2022" "liburing-2.2" "liburing Manual"
|
|
6
|
+
.SH NAME
|
|
7
|
+
io_uring_unregister_ring_fd \- unregister a ring file descriptor
|
|
8
|
+
.SH SYNOPSIS
|
|
9
|
+
.nf
|
|
10
|
+
.B #include <liburing.h>
|
|
11
|
+
.PP
|
|
12
|
+
.BI "int io_uring_unregister_ring_fd(struct io_uring *" ring ");"
|
|
13
|
+
.fi
|
|
14
|
+
.SH DESCRIPTION
|
|
15
|
+
.PP
|
|
16
|
+
.BR io_uring_unregister_ring_fd (3)
|
|
17
|
+
unregisters the file descriptor of the ring.
|
|
18
|
+
|
|
19
|
+
Unregisters a ring descriptor previously registered with the task. This is
|
|
20
|
+
done automatically when
|
|
21
|
+
.BR io_uring_queue_exit (3)
|
|
22
|
+
is called, but can also be done to free up space for new ring registrations.
|
|
23
|
+
For more information on ring descriptor registration, see
|
|
24
|
+
.BR io_uring_register_ring_fd (3)
|
|
25
|
+
|
|
26
|
+
.SH RETURN VALUE
|
|
27
|
+
Returns 1 on success, indicating that one file descriptor was unregistered, or
|
|
28
|
+
.BR -errno
|
|
29
|
+
on error.
|
|
30
|
+
.SH SEE ALSO
|
|
31
|
+
.BR io_uring_register_ring_fd (3),
|
|
32
|
+
.BR io_uring_register_files (3)
|
|
@@ -4,30 +4,37 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_wait_cqe 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_wait_cqe
|
|
7
|
+
io_uring_wait_cqe \- wait for one io_uring completion event
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "int io_uring_wait_cqe(struct io_uring *ring,"
|
|
13
|
-
.BI " struct io_uring_cqe **cqe_ptr);"
|
|
12
|
+
.BI "int io_uring_wait_cqe(struct io_uring *" ring ","
|
|
13
|
+
.BI " struct io_uring_cqe **" cqe_ptr ");"
|
|
14
14
|
.fi
|
|
15
|
-
.PP
|
|
16
15
|
.SH DESCRIPTION
|
|
17
16
|
.PP
|
|
18
|
-
The
|
|
19
|
-
|
|
17
|
+
The
|
|
18
|
+
.BR io_uring_wait_cqe (3)
|
|
19
|
+
function waits for an IO completion from the queue belonging to the
|
|
20
20
|
.I ring
|
|
21
|
-
param, waiting for it if necessary.
|
|
21
|
+
param, waiting for it if necessary. If an event is already available in
|
|
22
|
+
the ring when invoked, no waiting will occur. The
|
|
22
23
|
.I cqe_ptr
|
|
23
24
|
param is filled in on success.
|
|
24
25
|
|
|
25
|
-
After the caller has submitted a request with
|
|
26
|
-
|
|
26
|
+
After the caller has submitted a request with
|
|
27
|
+
.BR io_uring_submit (3),
|
|
28
|
+
the application can retrieve the completion with
|
|
29
|
+
.BR io_uring_wait_cqe (3).
|
|
27
30
|
|
|
28
31
|
.SH RETURN VALUE
|
|
29
32
|
On success
|
|
30
33
|
.BR io_uring_wait_cqe (3)
|
|
31
|
-
returns 0 and the cqe_ptr
|
|
34
|
+
returns 0 and the cqe_ptr param is filled in. On failure it returns
|
|
35
|
+
.BR -errno .
|
|
36
|
+
The return value indicates the result of waiting for a CQE, and it has no
|
|
37
|
+
relation to the CQE result itself.
|
|
32
38
|
.SH SEE ALSO
|
|
33
|
-
.BR io_uring_submit (3),
|
|
39
|
+
.BR io_uring_submit (3),
|
|
40
|
+
.BR io_uring_wait_cqes (3)
|
|
@@ -4,33 +4,40 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_wait_cqe_nr 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_wait_cqe_nr
|
|
7
|
+
io_uring_wait_cqe_nr \- wait for one or more io_uring completion events
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "int io_uring_wait_cqe_nr(struct io_uring *ring,"
|
|
13
|
-
.BI " struct io_uring_cqe **cqe_ptr,"
|
|
14
|
-
.BI " unsigned wait_nr)"
|
|
12
|
+
.BI "int io_uring_wait_cqe_nr(struct io_uring *" ring ","
|
|
13
|
+
.BI " struct io_uring_cqe **" cqe_ptr ","
|
|
14
|
+
.BI " unsigned " wait_nr ");"
|
|
15
15
|
.fi
|
|
16
|
-
.PP
|
|
17
16
|
.SH DESCRIPTION
|
|
18
17
|
.PP
|
|
19
|
-
The
|
|
18
|
+
The
|
|
19
|
+
.BR io_uring_wait_cqe_nr (3)
|
|
20
|
+
function returns
|
|
20
21
|
.I wait_nr
|
|
21
|
-
IO completion events from the
|
|
22
|
-
queue belonging to the
|
|
22
|
+
IO completion events from the queue belonging to the
|
|
23
23
|
.I ring
|
|
24
|
-
param, waiting for it if necessary.
|
|
24
|
+
param, waiting for it if necessary. If the requested number of events are
|
|
25
|
+
already available in the ring when invoked, no waiting will occur. The
|
|
25
26
|
.I cqe_ptr
|
|
26
27
|
param is filled in on success.
|
|
27
28
|
|
|
28
|
-
After the caller has submitted a request with
|
|
29
|
-
|
|
29
|
+
After the caller has submitted a request with
|
|
30
|
+
.BR io_uring_submit (3),
|
|
31
|
+
the application can retrieve the completion with
|
|
32
|
+
.BR io_uring_wait_cqe (3).
|
|
30
33
|
|
|
31
34
|
.SH RETURN VALUE
|
|
32
35
|
On success
|
|
33
36
|
.BR io_uring_wait_cqe_nr (3)
|
|
34
|
-
returns 0 and the cqe_ptr
|
|
37
|
+
returns 0 and the cqe_ptr param is filled in. On failure it returns
|
|
38
|
+
.BR -errno .
|
|
39
|
+
The return value indicates the result of waiting for a CQE, and it has no
|
|
40
|
+
relation to the CQE result itself.
|
|
35
41
|
.SH SEE ALSO
|
|
36
|
-
.BR io_uring_submit (3),
|
|
42
|
+
.BR io_uring_submit (3),
|
|
43
|
+
.BR io_uring_wait_cqes (3)
|
|
@@ -4,23 +4,26 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_wait_cqe_timeout 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_wait_cqe_timeout
|
|
7
|
+
io_uring_wait_cqe_timeout \- wait for one io_uring completion event with timeout
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
11
|
-
.PP
|
|
12
|
-
.BI "int io_uring_wait_cqe_timeout(struct io_uring *ring,"
|
|
13
|
-
.BI " struct io_uring_cqe **cqe_ptr,"
|
|
14
|
-
.BI " struct __kernel_timespec *ts)"
|
|
10
|
+
.B #include <liburing.h>
|
|
15
11
|
.PP
|
|
12
|
+
.BI "int io_uring_wait_cqe_timeout(struct io_uring *" ring ","
|
|
13
|
+
.BI " struct io_uring_cqe **" cqe_ptr ","
|
|
14
|
+
.BI " struct __kernel_timespec *" ts ");"
|
|
15
|
+
.fi
|
|
16
16
|
.SH DESCRIPTION
|
|
17
17
|
.PP
|
|
18
|
-
The
|
|
19
|
-
|
|
18
|
+
The
|
|
19
|
+
.BR io_uring_wait_cqe_timeout (3)
|
|
20
|
+
function waits for one IO completion to be available from the queue belonging
|
|
21
|
+
to the
|
|
20
22
|
.I ring
|
|
21
23
|
param, waiting for it if necessary or until the timeout
|
|
22
24
|
.I ts
|
|
23
|
-
expires.
|
|
25
|
+
expires. If an event is already available in the ring when invoked, no waiting
|
|
26
|
+
will occur.
|
|
24
27
|
|
|
25
28
|
The
|
|
26
29
|
.I cqe_ptr
|
|
@@ -28,12 +31,23 @@ param is filled in on success.
|
|
|
28
31
|
|
|
29
32
|
If
|
|
30
33
|
.I ts
|
|
31
|
-
is specified
|
|
32
|
-
|
|
34
|
+
is specified and an older kernel without
|
|
35
|
+
.B IORING_FEAT_EXT_ARG
|
|
36
|
+
is used, the application does not need to call
|
|
37
|
+
.BR io_uring_submit (3)
|
|
38
|
+
before calling
|
|
39
|
+
.BR io_uring_wait_cqes (3).
|
|
40
|
+
For newer kernels with that feature flag set, there is no implied submit
|
|
41
|
+
when waiting for a request.
|
|
33
42
|
|
|
34
43
|
.SH RETURN VALUE
|
|
35
44
|
On success
|
|
36
45
|
.BR io_uring_wait_cqes (3)
|
|
37
|
-
returns 0 and the cqe_ptr
|
|
46
|
+
returns 0 and the cqe_ptr param is filled in. On failure it returns
|
|
47
|
+
.BR -errno .
|
|
48
|
+
The return value indicates the result of waiting for a CQE, and it has no
|
|
49
|
+
relation to the CQE result itself.
|
|
38
50
|
.SH SEE ALSO
|
|
39
|
-
.BR io_uring_submit (3),
|
|
51
|
+
.BR io_uring_submit (3),
|
|
52
|
+
.BR io_uring_wait_cqe_timeout (3),
|
|
53
|
+
.BR io_uring_wait_cqe (3)
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_wait_cqes 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_wait_cqes
|
|
7
|
+
io_uring_wait_cqes \- wait for one or more io_uring completion events
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "int io_uring_wait_cqes(struct io_uring *ring,"
|
|
13
|
-
.BI " struct io_uring_cqe **cqe_ptr,"
|
|
14
|
-
.BI " unsigned wait_nr,"
|
|
15
|
-
.BI " struct __kernel_timespec *ts,"
|
|
16
|
-
.BI " sigset_t *sigmask)
|
|
12
|
+
.BI "int io_uring_wait_cqes(struct io_uring *" ring ","
|
|
13
|
+
.BI " struct io_uring_cqe **" cqe_ptr ","
|
|
14
|
+
.BI " unsigned " wait_nr ","
|
|
15
|
+
.BI " struct __kernel_timespec *" ts ","
|
|
16
|
+
.BI " sigset_t *" sigmask ");
|
|
17
17
|
.fi
|
|
18
|
-
.PP
|
|
19
18
|
.SH DESCRIPTION
|
|
20
19
|
.PP
|
|
21
|
-
The
|
|
20
|
+
The
|
|
21
|
+
.BR io_uring_wait_cqes (3)
|
|
22
|
+
function returns
|
|
22
23
|
.I wait_nr
|
|
23
24
|
IO completions from the queue belonging to the
|
|
24
25
|
.I ring
|
|
25
|
-
param, waiting for
|
|
26
|
+
param, waiting for them if necessary or until the timeout
|
|
26
27
|
.I ts
|
|
27
28
|
expires. The
|
|
28
29
|
.I sigmask
|
|
@@ -35,12 +36,21 @@ param is filled in on success.
|
|
|
35
36
|
|
|
36
37
|
If
|
|
37
38
|
.I ts
|
|
38
|
-
is specified
|
|
39
|
-
|
|
39
|
+
is specified and an older kernel without
|
|
40
|
+
.B IORING_FEAT_EXT_ARG
|
|
41
|
+
is used, the application does not need to call
|
|
42
|
+
.BR io_uring_submit (3)
|
|
43
|
+
before calling
|
|
44
|
+
.BR io_uring_wait_cqes (3).
|
|
45
|
+
For newer kernels with that feature flag set, there is no implied submit
|
|
46
|
+
when waiting for a request.
|
|
40
47
|
|
|
41
48
|
.SH RETURN VALUE
|
|
42
49
|
On success
|
|
43
50
|
.BR io_uring_wait_cqes (3)
|
|
44
|
-
returns 0 and the cqe_ptr
|
|
51
|
+
returns 0 and the cqe_ptr param is filled in. On failure it returns
|
|
52
|
+
.BR -errno .
|
|
45
53
|
.SH SEE ALSO
|
|
46
|
-
.BR io_uring_submit (3),
|
|
54
|
+
.BR io_uring_submit (3),
|
|
55
|
+
.BR io_uring_wait_cqe_timeout (3),
|
|
56
|
+
.BR io_uring_wait_cqe (3)
|
|
@@ -5,19 +5,22 @@ includedir ?= $(prefix)/include
|
|
|
5
5
|
libdir ?= $(prefix)/lib
|
|
6
6
|
libdevdir ?= $(prefix)/lib
|
|
7
7
|
|
|
8
|
+
LIBURING_CFLAGS ?=
|
|
8
9
|
CPPFLAGS ?=
|
|
9
10
|
override CPPFLAGS += -D_GNU_SOURCE \
|
|
10
11
|
-Iinclude/ -include ../config-host.h
|
|
11
|
-
CFLAGS ?= -g -
|
|
12
|
-
override CFLAGS += -Wno-unused-parameter -Wno-sign-compare
|
|
12
|
+
CFLAGS ?= -g -O3 -Wall -Wextra -fno-stack-protector
|
|
13
|
+
override CFLAGS += -Wno-unused-parameter -Wno-sign-compare \
|
|
14
|
+
-DLIBURING_INTERNAL \
|
|
15
|
+
$(LIBURING_CFLAGS)
|
|
13
16
|
SO_CFLAGS=-fPIC $(CFLAGS)
|
|
14
17
|
L_CFLAGS=$(CFLAGS)
|
|
15
18
|
LINK_FLAGS=
|
|
16
19
|
LINK_FLAGS+=$(LDFLAGS)
|
|
17
20
|
ENABLE_SHARED ?= 1
|
|
18
21
|
|
|
19
|
-
soname=liburing.so
|
|
20
|
-
libname
|
|
22
|
+
soname=liburing.so.$(VERSION_MAJOR)
|
|
23
|
+
libname=liburing.so.$(VERSION)
|
|
21
24
|
all_targets += liburing.a
|
|
22
25
|
|
|
23
26
|
ifeq ($(ENABLE_SHARED),1)
|
|
@@ -32,15 +35,13 @@ endif
|
|
|
32
35
|
|
|
33
36
|
all: $(all_targets)
|
|
34
37
|
|
|
35
|
-
liburing_srcs := setup.c queue.c register.c
|
|
38
|
+
liburing_srcs := setup.c queue.c register.c syscall.c
|
|
36
39
|
|
|
37
40
|
ifeq ($(CONFIG_NOLIBC),y)
|
|
38
41
|
liburing_srcs += nolibc.c
|
|
39
42
|
override CFLAGS += -nostdlib -nodefaultlibs -ffreestanding
|
|
40
43
|
override CPPFLAGS += -nostdlib -nodefaultlibs -ffreestanding
|
|
41
44
|
override LINK_FLAGS += -nostdlib -nodefaultlibs
|
|
42
|
-
else
|
|
43
|
-
liburing_srcs += syscall.c
|
|
44
45
|
endif
|
|
45
46
|
|
|
46
47
|
override CPPFLAGS += -MT "$@" -MMD -MP -MF "$@.d"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MIT */
|
|
2
|
+
|
|
3
|
+
#ifndef LIBURING_ARCH_AARCH64_LIB_H
|
|
4
|
+
#define LIBURING_ARCH_AARCH64_LIB_H
|
|
5
|
+
|
|
6
|
+
#include <elf.h>
|
|
7
|
+
#include <sys/auxv.h>
|
|
8
|
+
#include "../../syscall.h"
|
|
9
|
+
|
|
10
|
+
static inline long __get_page_size(void)
|
|
11
|
+
{
|
|
12
|
+
Elf64_Off buf[2];
|
|
13
|
+
long ret = 4096;
|
|
14
|
+
int fd;
|
|
15
|
+
|
|
16
|
+
fd = __sys_open("/proc/self/auxv", O_RDONLY, 0);
|
|
17
|
+
if (fd < 0)
|
|
18
|
+
return ret;
|
|
19
|
+
|
|
20
|
+
while (1) {
|
|
21
|
+
ssize_t x;
|
|
22
|
+
|
|
23
|
+
x = __sys_read(fd, buf, sizeof(buf));
|
|
24
|
+
if (x < sizeof(buf))
|
|
25
|
+
break;
|
|
26
|
+
|
|
27
|
+
if (buf[0] == AT_PAGESZ) {
|
|
28
|
+
ret = buf[1];
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
__sys_close(fd);
|
|
34
|
+
return ret;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static inline long get_page_size(void)
|
|
38
|
+
{
|
|
39
|
+
static long cache_val;
|
|
40
|
+
|
|
41
|
+
if (cache_val)
|
|
42
|
+
return cache_val;
|
|
43
|
+
|
|
44
|
+
cache_val = __get_page_size();
|
|
45
|
+
return cache_val;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#endif /* #ifndef LIBURING_ARCH_AARCH64_LIB_H */
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
/* SPDX-License-Identifier: MIT */
|
|
2
2
|
|
|
3
|
-
#ifndef __INTERNAL__LIBURING_SYSCALL_H
|
|
4
|
-
#error "This file should be included from src/syscall.h (liburing)"
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
3
|
#ifndef LIBURING_ARCH_GENERIC_SYSCALL_H
|
|
8
4
|
#define LIBURING_ARCH_GENERIC_SYSCALL_H
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
#include <fcntl.h>
|
|
7
|
+
|
|
8
|
+
static inline int __sys_io_uring_register(unsigned int fd, unsigned int opcode,
|
|
9
|
+
const void *arg, unsigned int nr_args)
|
|
12
10
|
{
|
|
13
11
|
int ret;
|
|
14
12
|
ret = syscall(__NR_io_uring_register, fd, opcode, arg, nr_args);
|
|
15
13
|
return (ret < 0) ? -errno : ret;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
static inline int
|
|
19
|
-
|
|
16
|
+
static inline int __sys_io_uring_setup(unsigned int entries,
|
|
17
|
+
struct io_uring_params *p)
|
|
20
18
|
{
|
|
21
19
|
int ret;
|
|
22
20
|
ret = syscall(__NR_io_uring_setup, entries, p);
|
|
23
21
|
return (ret < 0) ? -errno : ret;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
static inline int
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
static inline int __sys_io_uring_enter2(unsigned int fd, unsigned int to_submit,
|
|
25
|
+
unsigned int min_complete,
|
|
26
|
+
unsigned int flags, sigset_t *sig,
|
|
27
|
+
size_t sz)
|
|
29
28
|
{
|
|
30
29
|
int ret;
|
|
31
30
|
ret = syscall(__NR_io_uring_enter, fd, to_submit, min_complete, flags,
|
|
@@ -33,12 +32,26 @@ static inline int ____sys_io_uring_enter2(int fd, unsigned to_submit,
|
|
|
33
32
|
return (ret < 0) ? -errno : ret;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
static inline int
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
static inline int __sys_io_uring_enter(unsigned int fd, unsigned int to_submit,
|
|
36
|
+
unsigned int min_complete,
|
|
37
|
+
unsigned int flags, sigset_t *sig)
|
|
38
|
+
{
|
|
39
|
+
return __sys_io_uring_enter2(fd, to_submit, min_complete, flags, sig,
|
|
40
|
+
_NSIG / 8);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static inline int __sys_open(const char *pathname, int flags, mode_t mode)
|
|
39
44
|
{
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
int ret;
|
|
46
|
+
ret = open(pathname, flags, mode);
|
|
47
|
+
return (ret < 0) ? -errno : ret;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static inline ssize_t __sys_read(int fd, void *buffer, size_t size)
|
|
51
|
+
{
|
|
52
|
+
ssize_t ret;
|
|
53
|
+
ret = read(fd, buffer, size);
|
|
54
|
+
return (ret < 0) ? -errno : ret;
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
static inline void *__sys_mmap(void *addr, size_t length, int prot, int flags,
|
|
@@ -3,11 +3,37 @@
|
|
|
3
3
|
#ifndef LIBURING_ARCH_SYSCALL_DEFS_H
|
|
4
4
|
#define LIBURING_ARCH_SYSCALL_DEFS_H
|
|
5
5
|
|
|
6
|
+
#include <fcntl.h>
|
|
7
|
+
|
|
8
|
+
static inline int __sys_open(const char *pathname, int flags, mode_t mode)
|
|
9
|
+
{
|
|
10
|
+
/*
|
|
11
|
+
* Some architectures don't have __NR_open, but __NR_openat.
|
|
12
|
+
*/
|
|
13
|
+
#ifdef __NR_open
|
|
14
|
+
return (int) __do_syscall3(__NR_open, pathname, flags, mode);
|
|
15
|
+
#else
|
|
16
|
+
return (int) __do_syscall4(__NR_openat, AT_FDCWD, pathname, flags, mode);
|
|
17
|
+
#endif
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static inline ssize_t __sys_read(int fd, void *buffer, size_t size)
|
|
21
|
+
{
|
|
22
|
+
return (ssize_t) __do_syscall3(__NR_read, fd, buffer, size);
|
|
23
|
+
}
|
|
24
|
+
|
|
6
25
|
static inline void *__sys_mmap(void *addr, size_t length, int prot, int flags,
|
|
7
26
|
int fd, off_t offset)
|
|
8
27
|
{
|
|
9
|
-
|
|
10
|
-
|
|
28
|
+
int nr;
|
|
29
|
+
|
|
30
|
+
#if defined(__NR_mmap2)
|
|
31
|
+
nr = __NR_mmap2;
|
|
32
|
+
offset >>= 12;
|
|
33
|
+
#else
|
|
34
|
+
nr = __NR_mmap;
|
|
35
|
+
#endif
|
|
36
|
+
return (void *) __do_syscall6(nr, addr, length, prot, flags, fd, offset);
|
|
11
37
|
}
|
|
12
38
|
|
|
13
39
|
static inline int __sys_munmap(void *addr, size_t length)
|
|
@@ -35,33 +61,34 @@ static inline int __sys_close(int fd)
|
|
|
35
61
|
return (int) __do_syscall1(__NR_close, fd);
|
|
36
62
|
}
|
|
37
63
|
|
|
38
|
-
static inline int
|
|
39
|
-
|
|
64
|
+
static inline int __sys_io_uring_register(unsigned int fd, unsigned int opcode,
|
|
65
|
+
const void *arg, unsigned int nr_args)
|
|
40
66
|
{
|
|
41
67
|
return (int) __do_syscall4(__NR_io_uring_register, fd, opcode, arg,
|
|
42
68
|
nr_args);
|
|
43
69
|
}
|
|
44
70
|
|
|
45
|
-
static inline int
|
|
46
|
-
|
|
71
|
+
static inline int __sys_io_uring_setup(unsigned int entries,
|
|
72
|
+
struct io_uring_params *p)
|
|
47
73
|
{
|
|
48
74
|
return (int) __do_syscall2(__NR_io_uring_setup, entries, p);
|
|
49
75
|
}
|
|
50
76
|
|
|
51
|
-
static inline int
|
|
52
|
-
|
|
53
|
-
|
|
77
|
+
static inline int __sys_io_uring_enter2(unsigned int fd, unsigned int to_submit,
|
|
78
|
+
unsigned int min_complete,
|
|
79
|
+
unsigned int flags, sigset_t *sig,
|
|
80
|
+
size_t sz)
|
|
54
81
|
{
|
|
55
82
|
return (int) __do_syscall6(__NR_io_uring_enter, fd, to_submit,
|
|
56
83
|
min_complete, flags, sig, sz);
|
|
57
84
|
}
|
|
58
85
|
|
|
59
|
-
static inline int
|
|
60
|
-
|
|
61
|
-
|
|
86
|
+
static inline int __sys_io_uring_enter(unsigned int fd, unsigned int to_submit,
|
|
87
|
+
unsigned int min_complete,
|
|
88
|
+
unsigned int flags, sigset_t *sig)
|
|
62
89
|
{
|
|
63
|
-
return
|
|
64
|
-
|
|
90
|
+
return __sys_io_uring_enter2(fd, to_submit, min_complete, flags, sig,
|
|
91
|
+
_NSIG / 8);
|
|
65
92
|
}
|
|
66
93
|
|
|
67
94
|
#endif
|