polyphony 0.93 → 0.95
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 +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,74 @@
|
|
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_tee 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_tee \- prepare a tee request
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <fcntl.h>
|
11
|
+
.B #include <liburing.h>
|
12
|
+
.PP
|
13
|
+
.BI "void io_uring_prep_tee(struct io_uring_sqe *" sqe ","
|
14
|
+
.BI " int " fd_in ","
|
15
|
+
.BI " int " fd_out ","
|
16
|
+
.BI " unsigned int " nbytes ","
|
17
|
+
.BI " unsigned int " splice_flags ");"
|
18
|
+
.fi
|
19
|
+
.SH DESCRIPTION
|
20
|
+
.PP
|
21
|
+
The
|
22
|
+
.BR io_uring_prep_tee (3)
|
23
|
+
function prepares a tee request. The submission queue entry
|
24
|
+
.I sqe
|
25
|
+
is setup to use as input the file descriptor
|
26
|
+
.I fd_in
|
27
|
+
and as output the file descriptor
|
28
|
+
.I fd_out
|
29
|
+
duplicating
|
30
|
+
.I nbytes
|
31
|
+
bytes worth of data.
|
32
|
+
.I splice_flags
|
33
|
+
are modifier flags for the operation. See
|
34
|
+
.BR tee (2)
|
35
|
+
for the generic splice flags.
|
36
|
+
|
37
|
+
If the
|
38
|
+
.I fd_out
|
39
|
+
descriptor,
|
40
|
+
.B IOSQE_FIXED_FILE
|
41
|
+
can be set in the SQE to indicate that. For the input file, the io_uring
|
42
|
+
specific
|
43
|
+
.B SPLICE_F_FD_IN_FIXED
|
44
|
+
can be set and
|
45
|
+
.I fd_in
|
46
|
+
given as a registered file descriptor offset.
|
47
|
+
|
48
|
+
This function prepares an async
|
49
|
+
.BR tee (2)
|
50
|
+
request. See that man page for details.
|
51
|
+
|
52
|
+
.SH RETURN VALUE
|
53
|
+
None
|
54
|
+
.SH ERRORS
|
55
|
+
The CQE
|
56
|
+
.I res
|
57
|
+
field will contain the result of the operation. See the related man page for
|
58
|
+
details on possible values. Note that where synchronous system calls will return
|
59
|
+
.B -1
|
60
|
+
on failure and set
|
61
|
+
.I errno
|
62
|
+
to the actual error value, io_uring never uses
|
63
|
+
.IR errno .
|
64
|
+
Instead it returns the negated
|
65
|
+
.I errno
|
66
|
+
directly in the CQE
|
67
|
+
.I res
|
68
|
+
field.
|
69
|
+
.SH SEE ALSO
|
70
|
+
.BR io_uring_get_sqe (3),
|
71
|
+
.BR io_uring_submit (3),
|
72
|
+
.BR io_uring_register (2),
|
73
|
+
.BR splice (2),
|
74
|
+
.BR tee (2)
|
@@ -0,0 +1,95 @@
|
|
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_poll_timeout 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_timeoute \- prepare a timeout request
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <liburing.h>
|
11
|
+
.PP
|
12
|
+
.BI "void io_uring_prep_timeout(struct io_uring_sqe *" sqe ","
|
13
|
+
.BI " struct __kernel_timespec *" ts ","
|
14
|
+
.BI " unsigned " count ","
|
15
|
+
.BI " unsigned " flags ");"
|
16
|
+
.fi
|
17
|
+
.SH DESCRIPTION
|
18
|
+
.PP
|
19
|
+
The
|
20
|
+
.BR io_uring_prep_timeout (3)
|
21
|
+
function prepares a timeout request. The submission queue entry
|
22
|
+
.I sqe
|
23
|
+
is setup to arm a timeout specified by
|
24
|
+
.I ts
|
25
|
+
and with a timeout count of
|
26
|
+
.I count
|
27
|
+
completion entries. The
|
28
|
+
.I flags
|
29
|
+
argument holds modifier flags for the request.
|
30
|
+
|
31
|
+
This request type can be used as a timeout waking anyone sleeping
|
32
|
+
for events on the CQ ring. The
|
33
|
+
.I flags
|
34
|
+
argument may contain:
|
35
|
+
.TP
|
36
|
+
.B IORING_TIMEOUT_ABS
|
37
|
+
The value specified in
|
38
|
+
.I ts
|
39
|
+
is an absolute value rather than a relative one.
|
40
|
+
.TP
|
41
|
+
.B IORING_TIMEOUT_BOOTTIME
|
42
|
+
The boottime clock source should be used.
|
43
|
+
.TP
|
44
|
+
.B IORING_TIMEOUT_REALTIME
|
45
|
+
The realtime clock source should be used.
|
46
|
+
.TP
|
47
|
+
.B IORING_TIMEOUT_ETIME_SUCCESS
|
48
|
+
Consider an expired timeout a success in terms of the posted completion.
|
49
|
+
Normally a timeout that triggers would return in a
|
50
|
+
.B -ETIME
|
51
|
+
CQE
|
52
|
+
.I res
|
53
|
+
value.
|
54
|
+
.PP
|
55
|
+
The timeout completion event will trigger if either the specified timeout
|
56
|
+
has occurred, or the specified number of events to wait for have been posted
|
57
|
+
to the CQ ring.
|
58
|
+
|
59
|
+
.SH RETURN VALUE
|
60
|
+
None
|
61
|
+
.SH ERRORS
|
62
|
+
These are the errors that are reported in the CQE
|
63
|
+
.I res
|
64
|
+
field. On success,
|
65
|
+
.B 0
|
66
|
+
is returned.
|
67
|
+
.TP
|
68
|
+
.B -ETIME
|
69
|
+
The specified timeout occurred and triggered the completion event.
|
70
|
+
.TP
|
71
|
+
.B -EINVAL
|
72
|
+
One of the fields set in the SQE was invalid. For example, two clocksources
|
73
|
+
where given, or the specified timeout seconds or nanoseconds where < 0.
|
74
|
+
.TP
|
75
|
+
.B -EFAULT
|
76
|
+
io_uring was unable to access the data specified by
|
77
|
+
.IR ts .
|
78
|
+
.TP
|
79
|
+
.B -ECANCELED
|
80
|
+
The timeout was canceled by a removal request.
|
81
|
+
.SH NOTES
|
82
|
+
As with any request that passes in data in a struct, that data must remain
|
83
|
+
valid until the request has been successfully submitted. It need not remain
|
84
|
+
valid until completion. Once a request has been submitted, the in-kernel
|
85
|
+
state is stable. Very early kernels (5.4 and earlier) required state to be
|
86
|
+
stable until the completion occurred. Applications can test for this
|
87
|
+
behavior by inspecting the
|
88
|
+
.B IORING_FEAT_SUBMIT_STABLE
|
89
|
+
flag passed back from
|
90
|
+
.BR io_uring_queue_init_params (3).
|
91
|
+
.SH SEE ALSO
|
92
|
+
.BR io_uring_get_sqe (3),
|
93
|
+
.BR io_uring_submit (3),
|
94
|
+
.BR io_uring_prep_timeout_remove (3),
|
95
|
+
.BR io_uring_prep_timeout_update (3)
|
@@ -0,0 +1 @@
|
|
1
|
+
io_uring_prep_timeout_update.3
|
@@ -0,0 +1,98 @@
|
|
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_poll_timeout_update 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_timeoute_update \- prepare a request to update an existing timeout
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <liburing.h>
|
11
|
+
.PP
|
12
|
+
.BI "void io_uring_prep_timeout_update(struct io_uring_sqe *" sqe ","
|
13
|
+
.BI " struct __kernel_timespec *" ts ","
|
14
|
+
.BI " __u64 " user_data ","
|
15
|
+
.BI " unsigned " flags ");"
|
16
|
+
.PP
|
17
|
+
.BI "void io_uring_prep_timeout_remove(struct io_uring_sqe *" sqe ","
|
18
|
+
.BI " __u64 " user_data ","
|
19
|
+
.BI " unsigned " flags ");"
|
20
|
+
.fi
|
21
|
+
.SH DESCRIPTION
|
22
|
+
.PP
|
23
|
+
These functions modify or cancel an existing timeout request. The submission
|
24
|
+
queue entry
|
25
|
+
.I sqe
|
26
|
+
is setup to arm a timeout update or removal specified by
|
27
|
+
.I user_data
|
28
|
+
and with modifier flags given by
|
29
|
+
.IR flags .
|
30
|
+
Additionally, the update request includes a
|
31
|
+
.I ts
|
32
|
+
structure, which contains new timeout information.
|
33
|
+
|
34
|
+
For an update request, the
|
35
|
+
.I flags
|
36
|
+
member may contain a bitmask of the following values:
|
37
|
+
.TP
|
38
|
+
.B IORING_TIMEOUT_ABS
|
39
|
+
The value specified in
|
40
|
+
.I ts
|
41
|
+
is an absolute value rather than a relative one.
|
42
|
+
.TP
|
43
|
+
.B IORING_TIMEOUT_BOOTTIME
|
44
|
+
The boottime clock source should be used.
|
45
|
+
.TP
|
46
|
+
.B IORING_TIMEOUT_REALTIME
|
47
|
+
The realtime clock source should be used.
|
48
|
+
.TP
|
49
|
+
.B IORING_TIMEOUT_ETIME_SUCCESS
|
50
|
+
Consider an expired timeout a success in terms of the posted completion.
|
51
|
+
Normally a timeout that triggers would return in a
|
52
|
+
.B -ETIME
|
53
|
+
CQE
|
54
|
+
.I res
|
55
|
+
value.
|
56
|
+
.PP
|
57
|
+
|
58
|
+
.SH RETURN VALUE
|
59
|
+
None
|
60
|
+
.SH ERRORS
|
61
|
+
These are the errors that are reported in the CQE
|
62
|
+
.I res
|
63
|
+
field. On success,
|
64
|
+
.B 0
|
65
|
+
is returned.
|
66
|
+
.TP
|
67
|
+
.B -ENOENT
|
68
|
+
The timeout identified by
|
69
|
+
.I user_data
|
70
|
+
could not be found. It may be invalid, or triggered before the update or
|
71
|
+
removal request was processed.
|
72
|
+
.TP
|
73
|
+
.B -EALREADY
|
74
|
+
The timeout identified by
|
75
|
+
.I user_data
|
76
|
+
is already firing and cannot be canceled.
|
77
|
+
.TP
|
78
|
+
.B -EINVAL
|
79
|
+
One of the fields set in the SQE was invalid. For example, two clocksources
|
80
|
+
where given, or the specified timeout seconds or nanoseconds where < 0.
|
81
|
+
.TP
|
82
|
+
.B -EFAULT
|
83
|
+
io_uring was unable to access the data specified by
|
84
|
+
.IR ts .
|
85
|
+
.SH NOTES
|
86
|
+
As with any request that passes in data in a struct, that data must remain
|
87
|
+
valid until the request has been successfully submitted. It need not remain
|
88
|
+
valid until completion. Once a request has been submitted, the in-kernel
|
89
|
+
state is stable. Very early kernels (5.4 and earlier) required state to be
|
90
|
+
stable until the completion occurred. Applications can test for this
|
91
|
+
behavior by inspecting the
|
92
|
+
.B IORING_FEAT_SUBMIT_STABLE
|
93
|
+
flag passed back from
|
94
|
+
.BR io_uring_queue_init_params (3).
|
95
|
+
.SH SEE ALSO
|
96
|
+
.BR io_uring_get_sqe (3),
|
97
|
+
.BR io_uring_submit (3),
|
98
|
+
.BR io_uring_prep_timeout (3)
|
@@ -0,0 +1 @@
|
|
1
|
+
io_uring_prep_unlinkat.3
|
@@ -0,0 +1,82 @@
|
|
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_unlinkat 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
|
6
|
+
.SH NAME
|
7
|
+
io_uring_prep_unlinkat \- prepare an unlinkat request
|
8
|
+
.SH SYNOPSIS
|
9
|
+
.nf
|
10
|
+
.B #include <fcntl.h>
|
11
|
+
.B #include <unistd.h>
|
12
|
+
.B #include <liburing.h>
|
13
|
+
.PP
|
14
|
+
.BI "void io_uring_prep_unlinkat(struct io_uring_sqe *" sqe ","
|
15
|
+
.BI " int " dirfd ","
|
16
|
+
.BI " const char *" path ","
|
17
|
+
.BI " int " flags ");"
|
18
|
+
.PP
|
19
|
+
.BI "void io_uring_prep_unlink(struct io_uring_sqe *" sqe ","
|
20
|
+
.BI " const char *" path ","
|
21
|
+
.BI " int " flags ");"
|
22
|
+
.fi
|
23
|
+
.SH DESCRIPTION
|
24
|
+
.PP
|
25
|
+
The
|
26
|
+
.BR io_uring_prep_unlinkat (3)
|
27
|
+
function prepares an unlinkat request. The submission queue entry
|
28
|
+
.I sqe
|
29
|
+
is setup to use the directory file descriptor pointed to by
|
30
|
+
.I dirfd
|
31
|
+
to start an unlinkat operation on the path identified by
|
32
|
+
.I path
|
33
|
+
and using the flags given in
|
34
|
+
.IR flags .
|
35
|
+
|
36
|
+
The
|
37
|
+
.BR io_uring_prep_unlink (3)
|
38
|
+
function prepares an unlink request. The submission queue entry
|
39
|
+
.I sqe
|
40
|
+
is setup to start an unlinkat operation on the path identified by
|
41
|
+
.I path
|
42
|
+
relative to the current working directory and using the flags given in
|
43
|
+
.IR flags .
|
44
|
+
|
45
|
+
These functions prepare an async
|
46
|
+
.BR unlinkat (2)
|
47
|
+
or
|
48
|
+
.BR unlink (2)
|
49
|
+
request. See those man pages for details.
|
50
|
+
|
51
|
+
.SH RETURN VALUE
|
52
|
+
None
|
53
|
+
.SH ERRORS
|
54
|
+
The CQE
|
55
|
+
.I res
|
56
|
+
field will contain the result of the operation. See the related man page for
|
57
|
+
details on possible values. Note that where synchronous system calls will return
|
58
|
+
.B -1
|
59
|
+
on failure and set
|
60
|
+
.I errno
|
61
|
+
to the actual error value, io_uring never uses
|
62
|
+
.IR errno .
|
63
|
+
Instead it returns the negated
|
64
|
+
.I errno
|
65
|
+
directly in the CQE
|
66
|
+
.I res
|
67
|
+
field.
|
68
|
+
.SH NOTES
|
69
|
+
As with any request that passes in data in a struct, that data must remain
|
70
|
+
valid until the request has been successfully submitted. It need not remain
|
71
|
+
valid until completion. Once a request has been submitted, the in-kernel
|
72
|
+
state is stable. Very early kernels (5.4 and earlier) required state to be
|
73
|
+
stable until the completion occurred. Applications can test for this
|
74
|
+
behavior by inspecting the
|
75
|
+
.B IORING_FEAT_SUBMIT_STABLE
|
76
|
+
flag passed back from
|
77
|
+
.BR io_uring_queue_init_params (3).
|
78
|
+
.SH SEE ALSO
|
79
|
+
.BR io_uring_get_sqe (3),
|
80
|
+
.BR io_uring_submit (3),
|
81
|
+
.BR unlinkat (2),
|
82
|
+
.BR unlink (2)
|
@@ -4,21 +4,22 @@
|
|
4
4
|
.\"
|
5
5
|
.TH io_uring_prep_write 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
6
6
|
.SH NAME
|
7
|
-
io_uring_prep_write
|
8
|
-
|
7
|
+
io_uring_prep_write \- prepare I/O write request
|
9
8
|
.SH SYNOPSIS
|
10
9
|
.nf
|
11
|
-
.
|
12
|
-
.PP
|
13
|
-
.BI "void io_uring_prep_write(struct io_uring_sqe *sqe,"
|
14
|
-
.BI " int fd,"
|
15
|
-
.BI " const void *buf,"
|
16
|
-
.BI " unsigned nbytes,"
|
17
|
-
.BI " __u64 offset)"
|
10
|
+
.B #include <liburing.h>
|
18
11
|
.PP
|
12
|
+
.BI "void io_uring_prep_write(struct io_uring_sqe *" sqe ","
|
13
|
+
.BI " int " fd ","
|
14
|
+
.BI " const void *" buf ","
|
15
|
+
.BI " unsigned " nbytes ","
|
16
|
+
.BI " __u64 " offset ");"
|
17
|
+
.fi
|
19
18
|
.SH DESCRIPTION
|
20
19
|
.PP
|
21
|
-
The
|
20
|
+
The
|
21
|
+
.BR io_uring_prep_write (3)
|
22
|
+
prepares an IO write request. The submission queue entry
|
22
23
|
.I sqe
|
23
24
|
is setup to use the file descriptor
|
24
25
|
.I fd
|
@@ -27,24 +28,40 @@ to start writing
|
|
27
28
|
from the buffer
|
28
29
|
.I buf
|
29
30
|
at the specified
|
30
|
-
.
|
31
|
+
.IR offset .
|
31
32
|
|
32
33
|
On files that support seeking, if the offset is set to
|
33
|
-
.
|
34
|
+
.BR -1 ,
|
34
35
|
the write operation commences at the file offset, and the file offset is
|
35
36
|
incremented by the number of bytes written. See
|
36
37
|
.BR write (2)
|
37
38
|
for more details. Note that for an async API, reading and updating the
|
38
39
|
current file offset may result in unpredictable behavior, unless access
|
39
|
-
to the file is serialized. It is not encouraged to use this feature
|
40
|
+
to the file is serialized. It is not encouraged to use this feature if it's
|
40
41
|
possible to provide the desired IO offset from the application or library.
|
41
42
|
|
42
|
-
On files that are not capable of seeking, the offset
|
43
|
+
On files that are not capable of seeking, the offset must be 0 or -1.
|
43
44
|
|
44
45
|
After the write has been prepared, it can be submitted with one of the submit
|
45
46
|
functions.
|
46
47
|
|
47
48
|
.SH RETURN VALUE
|
48
49
|
None
|
50
|
+
.SH ERRORS
|
51
|
+
The CQE
|
52
|
+
.I res
|
53
|
+
field will contain the result of the operation. See the related man page for
|
54
|
+
details on possible values. Note that where synchronous system calls will return
|
55
|
+
.B -1
|
56
|
+
on failure and set
|
57
|
+
.I errno
|
58
|
+
to the actual error value, io_uring never uses
|
59
|
+
.IR errno .
|
60
|
+
Instead it returns the negated
|
61
|
+
.I errno
|
62
|
+
directly in the CQE
|
63
|
+
.I res
|
64
|
+
field.
|
49
65
|
.SH SEE ALSO
|
50
|
-
.BR io_uring_get_sqe (3),
|
66
|
+
.BR io_uring_get_sqe (3),
|
67
|
+
.BR io_uring_submit (3)
|
@@ -4,23 +4,24 @@
|
|
4
4
|
.\"
|
5
5
|
.TH io_uring_prep_write 3 "February 13, 2022" "liburing-2.1" "liburing Manual"
|
6
6
|
.SH NAME
|
7
|
-
io_uring_prep_write_fixed
|
8
|
-
|
7
|
+
io_uring_prep_write_fixed \- prepare I/O write request with registered buffer
|
9
8
|
.SH SYNOPSIS
|
10
9
|
.nf
|
11
|
-
.
|
10
|
+
.B #include <liburing.h>
|
12
11
|
.PP
|
13
|
-
.BI "void io_uring_prep_write_fixed(struct io_uring_sqe *sqe,"
|
14
|
-
.BI " int fd,
|
15
|
-
.BI " const void *buf,"
|
16
|
-
.BI " unsigned nbytes,"
|
17
|
-
.BI " __u64 offset,"
|
18
|
-
.BI " int buf_index)"
|
19
|
-
|
12
|
+
.BI "void io_uring_prep_write_fixed(struct io_uring_sqe *" sqe ","
|
13
|
+
.BI " int " fd ",
|
14
|
+
.BI " const void *" buf ","
|
15
|
+
.BI " unsigned " nbytes ","
|
16
|
+
.BI " __u64 " offset ","
|
17
|
+
.BI " int " buf_index ");"
|
18
|
+
.fi
|
20
19
|
.SH DESCRIPTION
|
21
20
|
.PP
|
22
|
-
The
|
23
|
-
|
21
|
+
The
|
22
|
+
.BR io_uring_prep_write_fixed (3)
|
23
|
+
prepares an IO write request with a previously registered IO buffer. The
|
24
|
+
submission queue entry
|
24
25
|
.I sqe
|
25
26
|
is setup to use the file descriptor
|
26
27
|
.I fd
|
@@ -29,19 +30,20 @@ to start writing
|
|
29
30
|
from the buffer
|
30
31
|
.I buf
|
31
32
|
at the specified
|
32
|
-
.I offset
|
33
|
+
.I offset
|
33
34
|
and with the buffer matching the registered index of
|
34
|
-
.
|
35
|
+
.IR buf_index .
|
35
36
|
|
36
|
-
This
|
37
|
-
.
|
38
|
-
except it requires the
|
39
|
-
.
|
37
|
+
This works just like
|
38
|
+
.BR io_uring_prep_write (3)
|
39
|
+
except it requires the use of buffers that have been registered with
|
40
|
+
.BR io_uring_register_buffers (3).
|
41
|
+
The
|
40
42
|
.I buf
|
41
43
|
and
|
42
44
|
.I nbytes
|
43
|
-
arguments must fall within a region
|
44
|
-
.I buf_index
|
45
|
+
arguments must fall within a region specified by
|
46
|
+
.I buf_index
|
45
47
|
in the previously registered buffer. The buffer need not be aligned with
|
46
48
|
the start of the registered buffer.
|
47
49
|
|
@@ -50,5 +52,21 @@ functions.
|
|
50
52
|
|
51
53
|
.SH RETURN VALUE
|
52
54
|
None
|
55
|
+
.SH ERRORS
|
56
|
+
The CQE
|
57
|
+
.I res
|
58
|
+
field will contain the result of the operation. See the related man page for
|
59
|
+
details on possible values. Note that where synchronous system calls will return
|
60
|
+
.B -1
|
61
|
+
on failure and set
|
62
|
+
.I errno
|
63
|
+
to the actual error value, io_uring never uses
|
64
|
+
.IR errno .
|
65
|
+
Instead it returns the negated
|
66
|
+
.I errno
|
67
|
+
directly in the CQE
|
68
|
+
.I res
|
69
|
+
field.
|
53
70
|
.SH SEE ALSO
|
54
|
-
.BR io_uring_prep_write (3),
|
71
|
+
.BR io_uring_prep_write (3),
|
72
|
+
.BR io_uring_register_buffers (3)
|
@@ -4,22 +4,23 @@
|
|
4
4
|
.\"
|
5
5
|
.TH io_uring_prep_writev 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
6
6
|
.SH NAME
|
7
|
-
io_uring_prep_writev
|
8
|
-
|
7
|
+
io_uring_prep_writev \- prepare vector I/O write request
|
9
8
|
.SH SYNOPSIS
|
10
9
|
.nf
|
11
|
-
.
|
12
|
-
.
|
13
|
-
.BI "void io_uring_prep_writev(struct io_uring_sqe *sqe,"
|
14
|
-
.BI " int fd,"
|
15
|
-
.BI " const struct iovec *iovecs,"
|
16
|
-
.BI " unsigned nr_vecs,"
|
17
|
-
.BI " __u64 offset)"
|
10
|
+
.B #include <sys/uio.h>
|
11
|
+
.B #include <liburing.h>
|
18
12
|
.PP
|
13
|
+
.BI "void io_uring_prep_writev(struct io_uring_sqe *" sqe ","
|
14
|
+
.BI " int " fd ","
|
15
|
+
.BI " const struct iovec *" iovecs ","
|
16
|
+
.BI " unsigned " nr_vecs ","
|
17
|
+
.BI " __u64 " offset ");"
|
18
|
+
.fi
|
19
19
|
.SH DESCRIPTION
|
20
20
|
.PP
|
21
|
-
The
|
22
|
-
|
21
|
+
The
|
22
|
+
.BR io_uring_prep_writev (3)
|
23
|
+
prepares a vectored IO write request. The submission queue entry
|
23
24
|
.I sqe
|
24
25
|
is setup to use the file descriptor
|
25
26
|
.I fd
|
@@ -28,24 +29,57 @@ to start writing
|
|
28
29
|
from the
|
29
30
|
.I iovecs
|
30
31
|
array at the specified
|
31
|
-
.
|
32
|
+
.IR offset .
|
32
33
|
|
33
34
|
On files that support seeking, if the offset is set to
|
34
|
-
.
|
35
|
+
.BR -1 ,
|
35
36
|
the write operation commences at the file offset, and the file offset is
|
36
37
|
incremented by the number of bytes written. See
|
37
38
|
.BR write (2)
|
38
39
|
for more details. Note that for an async API, reading and updating the
|
39
40
|
current file offset may result in unpredictable behavior, unless access
|
40
|
-
to the file is serialized. It is not encouraged to use this feature
|
41
|
+
to the file is serialized. It is not encouraged to use this feature if it's
|
41
42
|
possible to provide the desired IO offset from the application or library.
|
42
43
|
|
43
|
-
On files that are not capable of seeking, the offset
|
44
|
+
On files that are not capable of seeking, the offset must be 0 or -1.
|
44
45
|
|
45
46
|
After the write has been prepared it can be submitted with one of the submit
|
46
47
|
functions.
|
47
48
|
|
48
49
|
.SH RETURN VALUE
|
49
50
|
None
|
51
|
+
.SH ERRORS
|
52
|
+
The CQE
|
53
|
+
.I res
|
54
|
+
field will contain the result of the operation. See the related man page for
|
55
|
+
details on possible values. Note that where synchronous system calls will return
|
56
|
+
.B -1
|
57
|
+
on failure and set
|
58
|
+
.I errno
|
59
|
+
to the actual error value, io_uring never uses
|
60
|
+
.IR errno .
|
61
|
+
Instead it returns the negated
|
62
|
+
.I errno
|
63
|
+
directly in the CQE
|
64
|
+
.I res
|
65
|
+
field.
|
66
|
+
.SH NOTES
|
67
|
+
Unless an application explicitly needs to pass in more than iovec, it is more
|
68
|
+
efficient to use
|
69
|
+
.BR io_uring_prep_write (3)
|
70
|
+
rather than this function, as no state has to be maintained for a
|
71
|
+
non-vectored IO request.
|
72
|
+
As with any request that passes in data in a struct, that data must remain
|
73
|
+
valid until the request has been successfully submitted. It need not remain
|
74
|
+
valid until completion. Once a request has been submitted, the in-kernel
|
75
|
+
state is stable. Very early kernels (5.4 and earlier) required state to be
|
76
|
+
stable until the completion occurred. Applications can test for this
|
77
|
+
behavior by inspecting the
|
78
|
+
.B IORING_FEAT_SUBMIT_STABLE
|
79
|
+
flag passed back from
|
80
|
+
.BR io_uring_queue_init_params (3).
|
50
81
|
.SH SEE ALSO
|
51
|
-
.BR io_uring_get_sqe (3),
|
82
|
+
.BR io_uring_get_sqe (3),
|
83
|
+
.BR io_uring_prep_write (3),
|
84
|
+
.BR io_uring_prep_writev2 (3),
|
85
|
+
.BR io_uring_submit (3)
|