polyphony 0.94 → 0.96
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +3 -3
- data/.github/workflows/test_io_uring.yml +4 -4
- data/.gitignore +3 -3
- data/CHANGELOG.md +19 -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/adapters/redis_blpop.rb +4 -3
- data/examples/adapters/redis_channels.rb +16 -7
- data/examples/core/await.rb +1 -1
- data/examples/io/readline.rb +19 -0
- data/ext/polyphony/backend_common.c +25 -3
- data/ext/polyphony/backend_io_uring.c +18 -16
- data/ext/polyphony/backend_libev.c +2 -2
- data/ext/polyphony/event.c +1 -1
- data/ext/polyphony/extconf.rb +5 -3
- data/ext/polyphony/fiber.c +5 -13
- data/ext/polyphony/io_extensions.c +1 -1
- data/ext/polyphony/pipe.c +1 -1
- data/ext/polyphony/polyphony.c +1 -1
- 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/adapters/readline.rb +6 -4
- data/lib/polyphony/adapters/redis.rb +28 -87
- data/lib/polyphony/core/channel.rb +15 -0
- data/lib/polyphony/core/sync.rb +4 -0
- data/lib/polyphony/debugger.rb +2 -2
- data/lib/polyphony/extensions/socket.rb +2 -0
- data/lib/polyphony/version.rb +1 -1
- data/lib/polyphony.rb +4 -0
- data/polyphony.gemspec +10 -10
- data/test/helper.rb +0 -5
- data/test/test_backend.rb +5 -1
- data/test/test_enumerator.rb +46 -0
- data/test/test_ext.rb +63 -0
- data/test/test_io.rb +241 -216
- data/test/test_socket.rb +1 -1
- data/test/test_thread_pool.rb +5 -5
- 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 +160 -52
- data/Gemfile.lock +0 -78
@@ -0,0 +1,33 @@
|
|
1
|
+
.\" Copyright (C) 2022 Dylan Yudaken
|
2
|
+
.\"
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
|
+
.\"
|
5
|
+
.TH io_uring_get_events 3 "September 5, 2022" "liburing-2.3" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_get_events \- Flush outstanding requests to CQE ring
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <liburing.h>
|
11
|
+
.PP
|
12
|
+
.BI "int io_uring_get_events(struct io_uring *" ring ");"
|
13
|
+
.fi
|
14
|
+
.SH DESCRIPTION
|
15
|
+
.PP
|
16
|
+
The
|
17
|
+
.BR io_uring_get_events (3)
|
18
|
+
function runs outstanding work and flushes completion events to the CQE ring.
|
19
|
+
|
20
|
+
There can be events needing to be flushed if the ring was full and had overflowed.
|
21
|
+
Alternatively if the ring was setup with the
|
22
|
+
.BR IORING_SETUP_DEFER_TASKRUN
|
23
|
+
flag then this will process outstanding tasks, possibly resulting in more CQEs.
|
24
|
+
|
25
|
+
.SH RETURN VALUE
|
26
|
+
On success
|
27
|
+
.BR io_uring_get_events (3)
|
28
|
+
returns 0. On failure it returns
|
29
|
+
.BR -errno .
|
30
|
+
.SH SEE ALSO
|
31
|
+
.BR io_uring_get_sqe (3),
|
32
|
+
.BR io_uring_submit_and_get_events (3),
|
33
|
+
.BR io_uring_cq_has_overflow (3)
|
@@ -2,21 +2,22 @@
|
|
2
2
|
.\"
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
4
|
.\"
|
5
|
-
.TH io_uring_get_probe "January 25, 2022" "liburing-2.1" "liburing Manual"
|
5
|
+
.TH io_uring_get_probe 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
6
6
|
.SH NAME
|
7
|
-
io_uring_get_probe
|
7
|
+
io_uring_get_probe \- get probe instance
|
8
8
|
.SH SYNOPSIS
|
9
9
|
.nf
|
10
|
-
.
|
10
|
+
.B #include <liburing.h>
|
11
11
|
.PP
|
12
|
-
.BI "io_uring_probe *io_uring_get_probe(void)"
|
12
|
+
.BI "io_uring_probe *io_uring_get_probe(void);"
|
13
13
|
.fi
|
14
|
-
.PP
|
15
14
|
.SH DESCRIPTION
|
16
15
|
.PP
|
17
|
-
The function
|
18
|
-
|
19
|
-
structure
|
16
|
+
The function
|
17
|
+
.BR io_uring_get_probe (3)
|
18
|
+
returns an allocated io_uring_probe structure to the caller. The caller is
|
19
|
+
responsible for freeing the structure with the function
|
20
|
+
.BR io_uring_free_probe (3).
|
20
21
|
|
21
22
|
.SH NOTES
|
22
23
|
Earlier versions of the Linux kernel do not support probe. If the kernel
|
@@ -5,24 +5,26 @@
|
|
5
5
|
.\"
|
6
6
|
.TH io_uring_get_sqe 3 "July 10, 2020" "liburing-0.7" "liburing Manual"
|
7
7
|
.SH NAME
|
8
|
-
io_uring_get_sqe
|
8
|
+
io_uring_get_sqe \- get the next available submission queue entry from the
|
9
9
|
submission queue
|
10
10
|
.SH SYNOPSIS
|
11
11
|
.nf
|
12
|
-
.
|
12
|
+
.B #include <liburing.h>
|
13
13
|
.PP
|
14
|
-
.BI "struct io_uring_sqe *io_uring_get_sqe(struct io_uring "
|
14
|
+
.BI "struct io_uring_sqe *io_uring_get_sqe(struct io_uring *" ring ");"
|
15
15
|
.fi
|
16
|
-
.PP
|
17
16
|
.SH DESCRIPTION
|
18
17
|
.PP
|
19
|
-
The
|
20
|
-
|
18
|
+
The
|
19
|
+
.BR io_uring_get_sqe (3)
|
20
|
+
function gets the next available submission queue entry from the submission
|
21
|
+
queue belonging to the
|
21
22
|
.I ring
|
22
23
|
param.
|
23
24
|
|
24
|
-
On success
|
25
|
-
|
25
|
+
On success
|
26
|
+
.BR io_uring_get_sqe (3)
|
27
|
+
returns a pointer to the submission queue entry. On failure NULL is returned.
|
26
28
|
|
27
29
|
If a submission queue entry is returned, it should be filled out via one of the
|
28
30
|
prep functions such as
|
@@ -30,9 +32,26 @@ prep functions such as
|
|
30
32
|
and submitted via
|
31
33
|
.BR io_uring_submit (3).
|
32
34
|
|
35
|
+
Note that neither
|
36
|
+
.BR io_uring_get_sqe
|
37
|
+
nor the prep functions set (or clear) the
|
38
|
+
.B user_data
|
39
|
+
field of the SQE. If the caller expects
|
40
|
+
.BR io_uring_cqe_get_data (3)
|
41
|
+
or
|
42
|
+
.BR io_uring_cqe_get_data64 (3)
|
43
|
+
to return valid data when reaping IO completions, either
|
44
|
+
.BR io_uring_sqe_set_data (3)
|
45
|
+
or
|
46
|
+
.BR io_uring_sqe_set_data64 (3)
|
47
|
+
.B MUST
|
48
|
+
have been called before submitting the request.
|
49
|
+
|
33
50
|
.SH RETURN VALUE
|
34
51
|
.BR io_uring_get_sqe (3)
|
35
52
|
returns a pointer to the next submission queue event on success and NULL on
|
36
|
-
failure.
|
53
|
+
failure. If NULL is returned, the SQ ring is currently full and entries must
|
54
|
+
be submitted for processing before new ones can get allocated.
|
37
55
|
.SH SEE ALSO
|
38
|
-
.BR io_uring_submit (3)
|
56
|
+
.BR io_uring_submit (3),
|
57
|
+
.BR io_uring_sqe_set_data (3)
|
@@ -2,28 +2,29 @@
|
|
2
2
|
.\"
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
4
|
.\"
|
5
|
-
.TH io_uring_opcode_supported "January 25, 2022" "liburing-2.1" "liburing Manual"
|
5
|
+
.TH io_uring_opcode_supported 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
6
6
|
.SH NAME
|
7
|
-
io_uring_opcode_supported
|
7
|
+
io_uring_opcode_supported \- is op code supported?
|
8
8
|
.SH SYNOPSIS
|
9
9
|
.nf
|
10
|
-
.
|
10
|
+
.B #include <liburing.h>
|
11
11
|
.PP
|
12
|
-
.BI "int io_uring_opcode_supported(struct io_uring_probe *probe,"
|
13
|
-
.BI " int
|
12
|
+
.BI "int io_uring_opcode_supported(struct io_uring_probe *" probe ","
|
13
|
+
.BI " int " opcode ");"
|
14
14
|
.fi
|
15
|
-
.PP
|
16
15
|
.SH DESCRIPTION
|
17
16
|
.PP
|
18
|
-
The function
|
19
|
-
|
17
|
+
The function
|
18
|
+
.BR io_uring_opcode_supported (3)
|
19
|
+
allows the caller to determine if the passed in
|
20
20
|
.I opcode
|
21
21
|
belonging to the
|
22
22
|
.I probe
|
23
23
|
param is supported. An instance of the io_uring_probe instance can be
|
24
|
-
obtained by calling the function
|
24
|
+
obtained by calling the function
|
25
|
+
.BR io_uring_get_probe (3).
|
25
26
|
|
26
27
|
.SH RETURN VALUE
|
27
28
|
On success it returns 1, otherwise it returns 0.
|
28
29
|
.SH SEE ALSO
|
29
|
-
.BR io_uring_get_probe (3)
|
30
|
+
.BR io_uring_get_probe (3)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
|
2
|
+
.\"
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
|
+
.\"
|
5
|
+
.TH io_uring_peek_cqe 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_peek_cqe \- check if an io_uring completion event is available
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <liburing.h>
|
11
|
+
.PP
|
12
|
+
.BI "int io_uring_peek_cqe(struct io_uring *" ring ","
|
13
|
+
.BI " struct io_uring_cqe **" cqe_ptr ");"
|
14
|
+
.fi
|
15
|
+
.SH DESCRIPTION
|
16
|
+
.PP
|
17
|
+
The
|
18
|
+
.BR io_uring_peek_cqe (3)
|
19
|
+
function returns an IO completion from the queue belonging to the
|
20
|
+
.I ring
|
21
|
+
param, if one is readily available. On successful return,
|
22
|
+
.I cqe_ptr
|
23
|
+
param is filled with a valid CQE entry.
|
24
|
+
|
25
|
+
This function does not enter the kernel to wait for an event, an event
|
26
|
+
is only returned if it's already available in the CQ ring.
|
27
|
+
|
28
|
+
.SH RETURN VALUE
|
29
|
+
On success
|
30
|
+
.BR io_uring_peek_cqe (3)
|
31
|
+
returns
|
32
|
+
.B 0
|
33
|
+
and the cqe_ptr parameter is filled in. On failure it returns
|
34
|
+
.BR -EAGAIN .
|
35
|
+
.SH SEE ALSO
|
36
|
+
.BR io_uring_submit (3),
|
37
|
+
.BR io_uring_wait_cqes (3),
|
38
|
+
.BR io_uring_wait_cqe (3)
|
@@ -0,0 +1,197 @@
|
|
1
|
+
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
|
2
|
+
.\"
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
|
+
.\"
|
5
|
+
.TH io_uring_prep_accept 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_accept \- prepare an accept request
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <sys/socket.h>
|
11
|
+
.B #include <liburing.h>
|
12
|
+
.PP
|
13
|
+
.BI "void io_uring_prep_accept(struct io_uring_sqe *" sqe ","
|
14
|
+
.BI " int " sockfd ","
|
15
|
+
.BI " struct sockaddr *" addr ","
|
16
|
+
.BI " socklen_t *" addrlen ","
|
17
|
+
.BI " int " flags ");"
|
18
|
+
.PP
|
19
|
+
.BI "void io_uring_prep_accept_direct(struct io_uring_sqe *" sqe ","
|
20
|
+
.BI " int " sockfd ","
|
21
|
+
.BI " struct sockaddr *" addr ","
|
22
|
+
.BI " socklen_t *" addrlen ","
|
23
|
+
.BI " int " flags ","
|
24
|
+
.BI " unsigned int " file_index ");"
|
25
|
+
.PP
|
26
|
+
.BI "void io_uring_prep_multishot_accept(struct io_uring_sqe *" sqe ","
|
27
|
+
.BI " int " sockfd ","
|
28
|
+
.BI " struct sockaddr *" addr ","
|
29
|
+
.BI " socklen_t *" addrlen ","
|
30
|
+
.BI " int " flags ");"
|
31
|
+
.PP
|
32
|
+
.BI "void io_uring_prep_multishot_accept_direct(struct io_uring_sqe *" sqe ","
|
33
|
+
.BI " int " sockfd ","
|
34
|
+
.BI " struct sockaddr *" addr ","
|
35
|
+
.BI " socklen_t *" addrlen ","
|
36
|
+
.BI " int " flags ");"
|
37
|
+
.fi
|
38
|
+
.SH DESCRIPTION
|
39
|
+
.PP
|
40
|
+
The
|
41
|
+
.BR io_uring_prep_accept (3)
|
42
|
+
function and its three variants prepare an accept request similar to
|
43
|
+
.BR accept4 (2).
|
44
|
+
The submission queue entry
|
45
|
+
.I sqe
|
46
|
+
is setup to use the file descriptor
|
47
|
+
.I sockfd
|
48
|
+
to start accepting a connection request described by the socket address at
|
49
|
+
.I addr
|
50
|
+
and of structure length
|
51
|
+
.I addrlen
|
52
|
+
and using modifier flags in
|
53
|
+
.IR flags .
|
54
|
+
|
55
|
+
The three variants allow combining the direct file table and multishot features.
|
56
|
+
|
57
|
+
Direct descriptors are io_uring private file descriptors. They
|
58
|
+
avoid some of the overhead associated with thread shared file tables and
|
59
|
+
can be used in any io_uring request that takes a file descriptor.
|
60
|
+
The two direct variants here create such direct descriptors.
|
61
|
+
Subsequent to their creation, they can be used by setting
|
62
|
+
.B IOSQE_FIXED_FILE
|
63
|
+
in the SQE
|
64
|
+
.I flags
|
65
|
+
member, and setting the SQE
|
66
|
+
.I fd
|
67
|
+
field to the direct descriptor value rather than the regular file
|
68
|
+
descriptor. Direct descriptors are managed like registered files.
|
69
|
+
|
70
|
+
To use an accept direct variant, the application must first have registered
|
71
|
+
a file table of a desired size using
|
72
|
+
.BR io_uring_register_files (3)
|
73
|
+
or
|
74
|
+
.BR io_uring_register_files_sparse (3).
|
75
|
+
Once registered,
|
76
|
+
.BR io_uring_prep_accept_direct (3)
|
77
|
+
allows an entry in that table to be specifically selected through the
|
78
|
+
.I file_index
|
79
|
+
argument.
|
80
|
+
If the specified entry already contains a file, the file will first be removed
|
81
|
+
from the table and closed, consistent with the behavior of updating an
|
82
|
+
existing file with
|
83
|
+
.BR io_uring_register_files_update (3).
|
84
|
+
.I file_index
|
85
|
+
can also be set to
|
86
|
+
.B IORING_FILE_INDEX_ALLOC
|
87
|
+
for this variant and
|
88
|
+
an unused table index will be dynamically chosen and returned.
|
89
|
+
Likewise,
|
90
|
+
.B io_uring_prep_multishot_accept_direct
|
91
|
+
will have an unused table index dynamically chosen and returned for each connection accepted.
|
92
|
+
If both forms of direct selection will be employed, specific and dynamic, see
|
93
|
+
.BR io_uring_register_file_alloc_range (3)
|
94
|
+
for setting up the table so dynamically chosen entries are made against
|
95
|
+
a different range than that targetted by specific requests.
|
96
|
+
|
97
|
+
Note that old kernels don't check the SQE
|
98
|
+
.I file_index
|
99
|
+
field meaning
|
100
|
+
applications cannot rely on a
|
101
|
+
.B -EINVAL
|
102
|
+
CQE
|
103
|
+
.I res
|
104
|
+
being returned when the kernel is too old because older kernels
|
105
|
+
may not recognize they are being asked to use a direct table slot.
|
106
|
+
|
107
|
+
When a direct descriptor accept request asks for a table slot to be
|
108
|
+
dynamically chosen but there are no free entries,
|
109
|
+
.B -ENFILE
|
110
|
+
is returned as the CQE
|
111
|
+
.IR res .
|
112
|
+
|
113
|
+
The multishot variants allow an application to issue
|
114
|
+
a single accept request, which will repeatedly trigger a CQE when a connection
|
115
|
+
request comes in. Like other multishot type requests, the application should
|
116
|
+
look at the CQE
|
117
|
+
.I flags
|
118
|
+
and see if
|
119
|
+
.B IORING_CQE_F_MORE
|
120
|
+
is set on completion as an indication of whether or not the accept request
|
121
|
+
will generate further CQEs. Note that for the multishot variants, setting
|
122
|
+
.B addr
|
123
|
+
and
|
124
|
+
.B addrlen
|
125
|
+
may not make a lot of sense, as the same value would be used for every
|
126
|
+
accepted connection. This means that the data written to
|
127
|
+
.B addr
|
128
|
+
may be overwritten by a new connection before the application has had time
|
129
|
+
to process a past connection. If the application knows that a new connection
|
130
|
+
cannot come in before a previous one has been processed, it may be used as
|
131
|
+
expected. The multishot variants are available since 5.19.
|
132
|
+
|
133
|
+
See the man page
|
134
|
+
.BR accept4 (2)
|
135
|
+
for details of the accept function itself.
|
136
|
+
|
137
|
+
.SH RETURN VALUE
|
138
|
+
None
|
139
|
+
.SH ERRORS
|
140
|
+
The CQE
|
141
|
+
.I res
|
142
|
+
field will contain the result of the operation.
|
143
|
+
|
144
|
+
.BR io_uring_prep_accept (3)
|
145
|
+
generates the installed file descriptor as its result.
|
146
|
+
|
147
|
+
.BR io_uring_prep_accept_direct (3)
|
148
|
+
and
|
149
|
+
.I file_index
|
150
|
+
set to a specific direct descriptor
|
151
|
+
generates
|
152
|
+
.B 0
|
153
|
+
on success.
|
154
|
+
The caller must remember which direct descriptor was picked for this request.
|
155
|
+
|
156
|
+
.BR io_uring_prep_accept_direct (3)
|
157
|
+
and
|
158
|
+
.I file_index
|
159
|
+
set to
|
160
|
+
.B IORING_FILE_INDEX_ALLOC
|
161
|
+
generates the dynamically chosen direct descriptor.
|
162
|
+
|
163
|
+
.BR io_uring_prep_multishot_accept (3)
|
164
|
+
generates the installed file descriptor in each result.
|
165
|
+
|
166
|
+
.BR io_uring_prep_multishot_accept_direct (3),
|
167
|
+
generates the dynamically chosen direct descriptor in each result.
|
168
|
+
|
169
|
+
Note that where synchronous system calls will return
|
170
|
+
.B -1
|
171
|
+
on failure and set
|
172
|
+
.I errno
|
173
|
+
to the actual error value, io_uring never uses
|
174
|
+
.IR errno .
|
175
|
+
Instead it generates the negated
|
176
|
+
.I errno
|
177
|
+
directly in the CQE
|
178
|
+
.I res
|
179
|
+
field.
|
180
|
+
.SH NOTES
|
181
|
+
As with any request that passes in data in a struct, that data must remain
|
182
|
+
valid until the request has been successfully submitted. It need not remain
|
183
|
+
valid until completion. Once a request has been submitted, the in-kernel
|
184
|
+
state is stable. Very early kernels (5.4 and earlier) required state to be
|
185
|
+
stable until the completion occurred. Applications can test for this
|
186
|
+
behavior by inspecting the
|
187
|
+
.B IORING_FEAT_SUBMIT_STABLE
|
188
|
+
flag passed back from
|
189
|
+
.BR io_uring_queue_init_params (3).
|
190
|
+
.SH SEE ALSO
|
191
|
+
.BR io_uring_get_sqe (3),
|
192
|
+
.BR io_uring_submit (3),
|
193
|
+
.BR io_uring_register_files (3),
|
194
|
+
.BR io_uring_register_files_sparse (3),
|
195
|
+
.BR io_uring_register_file_alloc_range (3),
|
196
|
+
.BR io_uring_register (2),
|
197
|
+
.BR accept4 (2)
|
@@ -0,0 +1 @@
|
|
1
|
+
io_uring_prep_accept.3
|
@@ -0,0 +1,118 @@
|
|
1
|
+
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
|
2
|
+
.\"
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
|
+
.\"
|
5
|
+
.TH io_uring_prep_cancel 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_cancel \- prepare a cancelation request
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <liburing.h>
|
11
|
+
.PP
|
12
|
+
.BI "void io_uring_prep_cancel64(struct io_uring_sqe *" sqe ","
|
13
|
+
.BI " __u64 " user_data ","
|
14
|
+
.BI " int " flags ");"
|
15
|
+
.PP
|
16
|
+
.BI "void io_uring_prep_cancel(struct io_uring_sqe *" sqe ","
|
17
|
+
.BI " void *" user_data ","
|
18
|
+
.BI " int " flags ");"
|
19
|
+
.PP
|
20
|
+
.BI "void io_uring_prep_cancel_fd(struct io_uring_sqe *" sqe ","
|
21
|
+
.BI " int " fd ","
|
22
|
+
.BI " int " flags ");"
|
23
|
+
.fi
|
24
|
+
.SH DESCRIPTION
|
25
|
+
.PP
|
26
|
+
The
|
27
|
+
.BR io_uring_prep_cancel (3)
|
28
|
+
function prepares a cancelation request. The submission queue entry
|
29
|
+
.I sqe
|
30
|
+
is prepared to cancel an existing request identified by
|
31
|
+
.IR user_data .
|
32
|
+
For the
|
33
|
+
.I flags
|
34
|
+
argument, see below.
|
35
|
+
|
36
|
+
.BR io_uring_prep_cancel64 (3)
|
37
|
+
is identical to
|
38
|
+
.BR io_uring_prep_cancel (3) ,
|
39
|
+
except it takes a 64-bit integer rather than a pointer type.
|
40
|
+
|
41
|
+
The cancelation request will attempt to find the previously issued request
|
42
|
+
identified by
|
43
|
+
.I user_data
|
44
|
+
and cancel it. The identifier is what the previously issued request has in
|
45
|
+
their
|
46
|
+
.I user_data
|
47
|
+
field in the SQE.
|
48
|
+
|
49
|
+
The
|
50
|
+
.BR io_uring_prep_cancel_fd (3)
|
51
|
+
function prepares a cancelation request. The submission queue entry
|
52
|
+
.I sqe
|
53
|
+
is prepared to cancel an existing request that used the file descriptor
|
54
|
+
.IR fd .
|
55
|
+
For the
|
56
|
+
.I flags
|
57
|
+
argument, see below.
|
58
|
+
|
59
|
+
The cancelation request will attempt to find the previously issued request
|
60
|
+
that used
|
61
|
+
.I fd
|
62
|
+
as the file descriptor and cancel it.
|
63
|
+
|
64
|
+
By default, the first request matching the criteria given will be canceled.
|
65
|
+
This can be modified with any of the following flags passed in:
|
66
|
+
.TP
|
67
|
+
.B IORING_ASYNC_CANCEL_ALL
|
68
|
+
Cancel all requests that match the given criteria, rather than just canceling
|
69
|
+
the first one found. Available since 5.19.
|
70
|
+
.TP
|
71
|
+
.B IORING_ASYNC_CANCEL_FD
|
72
|
+
Match based on the file descriptor used in the original request rather than
|
73
|
+
the user_data. This is what
|
74
|
+
.BR io_uring_prep_cancel_fd (3)
|
75
|
+
sets up. Available since 5.19.
|
76
|
+
.TP
|
77
|
+
.B IORING_ASYNC_CANCEL_ANY
|
78
|
+
Match any request in the ring, regardless of user_data or file descriptor.
|
79
|
+
Can be used to cancel any pending request in the ring. Available since 5.19.
|
80
|
+
.P
|
81
|
+
|
82
|
+
.SH RETURN VALUE
|
83
|
+
None
|
84
|
+
.SH ERRORS
|
85
|
+
These are the errors that are reported in the CQE
|
86
|
+
.I res
|
87
|
+
field. If no flags are used to cancel multiple requests,
|
88
|
+
.B 0
|
89
|
+
is returned on success. If flags are used to match multiple requests, then
|
90
|
+
a positive value is returned indicating how many requests were found and
|
91
|
+
canceled.
|
92
|
+
.TP
|
93
|
+
.B -ENOENT
|
94
|
+
The request identified by
|
95
|
+
.I user_data
|
96
|
+
could not be located. This could be because it completed before the cancelation
|
97
|
+
request was issued, or if an invalid identifier is used.
|
98
|
+
.TP
|
99
|
+
.B -EINVAL
|
100
|
+
One of the fields set in the SQE was invalid.
|
101
|
+
.TP
|
102
|
+
.B -EALREADY
|
103
|
+
The execution state of the request has progressed far enough that cancelation
|
104
|
+
is no longer possible. This should normally mean that it will complete shortly,
|
105
|
+
either successfully, or interrupted due to the cancelation.
|
106
|
+
.SH NOTES
|
107
|
+
Although the cancelation request uses async request syntax, the kernel side of
|
108
|
+
the cancelation is always run synchronously. It is guaranteed that a CQE is
|
109
|
+
always generated by the time the cancel request has been submitted. If the
|
110
|
+
cancelation is successful, the completion for the request targeted for
|
111
|
+
cancelation will have been posted by the time submission returns. For
|
112
|
+
.B -EALREADY
|
113
|
+
it may take a bit of time to do so. For this case, the caller must wait for the
|
114
|
+
canceled request to post its completion event.
|
115
|
+
.SH SEE ALSO
|
116
|
+
.BR io_uring_prep_poll_remove (3),
|
117
|
+
.BR io_uring_get_sqe (3),
|
118
|
+
.BR io_uring_submit (3)
|
@@ -0,0 +1 @@
|
|
1
|
+
io_uring_prep_cancel.3
|
@@ -0,0 +1,59 @@
|
|
1
|
+
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
|
2
|
+
.\"
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
|
+
.\"
|
5
|
+
.TH io_uring_prep_close 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_close \- prepare a file descriptor close request
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <liburing.h>
|
11
|
+
.PP
|
12
|
+
.BI "void io_uring_prep_close(struct io_uring_sqe *" sqe ","
|
13
|
+
.BI " int " fd ");"
|
14
|
+
.PP
|
15
|
+
.BI "void io_uring_prep_close_direct(struct io_uring_sqe *" sqe ","
|
16
|
+
.BI " unsigned " file_index ");"
|
17
|
+
.PP
|
18
|
+
.fi
|
19
|
+
.SH DESCRIPTION
|
20
|
+
.PP
|
21
|
+
The
|
22
|
+
.BR io_uring_prep_close (3)
|
23
|
+
function prepares a close request. The submission queue entry
|
24
|
+
.I sqe
|
25
|
+
is setup to close the file descriptor indicated by
|
26
|
+
.IR fd .
|
27
|
+
|
28
|
+
For a direct descriptor close request, the offset is specified by the
|
29
|
+
.I file_index
|
30
|
+
argument instead of the
|
31
|
+
.IR fd .
|
32
|
+
This is identical to unregistering the direct descriptor, and is provided as
|
33
|
+
a convenience.
|
34
|
+
|
35
|
+
These functions prepare an async
|
36
|
+
.BR close (2)
|
37
|
+
request. See that man page for details.
|
38
|
+
|
39
|
+
.SH RETURN VALUE
|
40
|
+
None
|
41
|
+
.SH ERRORS
|
42
|
+
The CQE
|
43
|
+
.I res
|
44
|
+
field will contain the result of the operation. See the related man page for
|
45
|
+
details on possible values. Note that where synchronous system calls will return
|
46
|
+
.B -1
|
47
|
+
on failure and set
|
48
|
+
.I errno
|
49
|
+
to the actual error value, io_uring never uses
|
50
|
+
.IR errno .
|
51
|
+
Instead it returns the negated
|
52
|
+
.I errno
|
53
|
+
directly in the CQE
|
54
|
+
.I res
|
55
|
+
field.
|
56
|
+
.SH SEE ALSO
|
57
|
+
.BR io_uring_get_sqe (3),
|
58
|
+
.BR io_uring_submit (3),
|
59
|
+
.BR close (2)
|
@@ -0,0 +1 @@
|
|
1
|
+
io_uring_prep_close.3
|
@@ -0,0 +1,66 @@
|
|
1
|
+
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
|
2
|
+
.\"
|
3
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
4
|
+
.\"
|
5
|
+
.TH io_uring_prep_connect 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_connect \- prepare a connect request
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <sys/types.h>
|
11
|
+
.B #include <sys/socket.h>
|
12
|
+
.B #include <liburing.h>
|
13
|
+
.PP
|
14
|
+
.BI "void io_uring_prep_connect(struct io_uring_sqe *" sqe ","
|
15
|
+
.BI " int " sockfd ","
|
16
|
+
.BI " const struct sockaddr *" addr ","
|
17
|
+
.BI " socklen_t " addrlen ");"
|
18
|
+
.fi
|
19
|
+
.SH DESCRIPTION
|
20
|
+
.PP
|
21
|
+
The
|
22
|
+
.BR io_uring_prep_connect (3)
|
23
|
+
function prepares a connect request. The submission queue entry
|
24
|
+
.I sqe
|
25
|
+
is setup to use the file descriptor
|
26
|
+
.I sockfd
|
27
|
+
to start connecting to the destination described by the socket address at
|
28
|
+
.I addr
|
29
|
+
and of structure length
|
30
|
+
.IR addrlen .
|
31
|
+
|
32
|
+
This function prepares an async
|
33
|
+
.BR connect (2)
|
34
|
+
request. See that man page for details.
|
35
|
+
|
36
|
+
.SH RETURN VALUE
|
37
|
+
None
|
38
|
+
.SH ERRORS
|
39
|
+
The CQE
|
40
|
+
.I res
|
41
|
+
field will contain the result of the operation. See the related man page for
|
42
|
+
details on possible values. Note that where synchronous system calls will return
|
43
|
+
.B -1
|
44
|
+
on failure and set
|
45
|
+
.I errno
|
46
|
+
to the actual error value, io_uring never uses
|
47
|
+
.IR errno .
|
48
|
+
Instead it returns the negated
|
49
|
+
.I errno
|
50
|
+
directly in the CQE
|
51
|
+
.I res
|
52
|
+
field.
|
53
|
+
.SH NOTES
|
54
|
+
As with any request that passes in data in a struct, that data must remain
|
55
|
+
valid until the request has been successfully submitted. It need not remain
|
56
|
+
valid until completion. Once a request has been submitted, the in-kernel
|
57
|
+
state is stable. Very early kernels (5.4 and earlier) required state to be
|
58
|
+
stable until the completion occurred. Applications can test for this
|
59
|
+
behavior by inspecting the
|
60
|
+
.B IORING_FEAT_SUBMIT_STABLE
|
61
|
+
flag passed back from
|
62
|
+
.BR io_uring_queue_init_params (3).
|
63
|
+
.SH SEE ALSO
|
64
|
+
.BR io_uring_get_sqe (3),
|
65
|
+
.BR io_uring_submit (3),
|
66
|
+
.BR connect (2)
|