polyphony 1.0.1 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/.github/workflows/test_io_uring.yml +1 -1
  4. data/.yardopts +1 -0
  5. data/CHANGELOG.md +9 -0
  6. data/README.md +1 -0
  7. data/TODO.md +6 -12
  8. data/docs/advanced-io.md +224 -0
  9. data/docs/cheat-sheet.md +2 -2
  10. data/docs/readme.md +1 -0
  11. data/examples/core/debug.rb +12 -0
  12. data/examples/core/rpc_benchmark.rb +136 -0
  13. data/examples/core/stream_mockup.rb +68 -0
  14. data/examples/core/throttled_loop_inside_move_on_after.rb +13 -0
  15. data/ext/polyphony/backend_common.c +3 -5
  16. data/ext/polyphony/backend_common.h +10 -1
  17. data/ext/polyphony/backend_io_uring.c +6 -6
  18. data/ext/polyphony/backend_libev.c +5 -5
  19. data/ext/polyphony/extconf.rb +6 -0
  20. data/ext/polyphony/fiber.c +21 -1
  21. data/lib/polyphony/extensions/fiber.rb +1 -0
  22. data/lib/polyphony/extensions/io.rb +74 -74
  23. data/lib/polyphony/extensions/object.rb +6 -0
  24. data/lib/polyphony/extensions/socket.rb +39 -39
  25. data/lib/polyphony/version.rb +1 -1
  26. data/polyphony.gemspec +3 -1
  27. data/test/stress.rb +1 -1
  28. data/test/test_fiber.rb +45 -1
  29. data/test/test_io.rb +46 -0
  30. data/test/test_process_supervision.rb +1 -1
  31. data/test/test_resource_pool.rb +1 -1
  32. data/test/test_scenarios.rb +38 -0
  33. data/test/test_socket.rb +1 -2
  34. data/test/test_thread_pool.rb +4 -2
  35. data/test/test_timer.rb +2 -2
  36. metadata +36 -149
  37. data/vendor/liburing/man/IO_URING_CHECK_VERSION.3 +0 -1
  38. data/vendor/liburing/man/IO_URING_VERSION_MAJOR.3 +0 -1
  39. data/vendor/liburing/man/IO_URING_VERSION_MINOR.3 +0 -1
  40. data/vendor/liburing/man/io_uring.7 +0 -781
  41. data/vendor/liburing/man/io_uring_buf_ring_add.3 +0 -53
  42. data/vendor/liburing/man/io_uring_buf_ring_advance.3 +0 -31
  43. data/vendor/liburing/man/io_uring_buf_ring_cq_advance.3 +0 -41
  44. data/vendor/liburing/man/io_uring_buf_ring_init.3 +0 -30
  45. data/vendor/liburing/man/io_uring_buf_ring_mask.3 +0 -27
  46. data/vendor/liburing/man/io_uring_check_version.3 +0 -72
  47. data/vendor/liburing/man/io_uring_close_ring_fd.3 +0 -43
  48. data/vendor/liburing/man/io_uring_cq_advance.3 +0 -49
  49. data/vendor/liburing/man/io_uring_cq_has_overflow.3 +0 -25
  50. data/vendor/liburing/man/io_uring_cq_ready.3 +0 -26
  51. data/vendor/liburing/man/io_uring_cqe_get_data.3 +0 -53
  52. data/vendor/liburing/man/io_uring_cqe_get_data64.3 +0 -1
  53. data/vendor/liburing/man/io_uring_cqe_seen.3 +0 -42
  54. data/vendor/liburing/man/io_uring_enter.2 +0 -1700
  55. data/vendor/liburing/man/io_uring_enter2.2 +0 -1
  56. data/vendor/liburing/man/io_uring_free_probe.3 +0 -27
  57. data/vendor/liburing/man/io_uring_get_events.3 +0 -33
  58. data/vendor/liburing/man/io_uring_get_probe.3 +0 -30
  59. data/vendor/liburing/man/io_uring_get_sqe.3 +0 -57
  60. data/vendor/liburing/man/io_uring_major_version.3 +0 -1
  61. data/vendor/liburing/man/io_uring_minor_version.3 +0 -1
  62. data/vendor/liburing/man/io_uring_opcode_supported.3 +0 -30
  63. data/vendor/liburing/man/io_uring_peek_cqe.3 +0 -38
  64. data/vendor/liburing/man/io_uring_prep_accept.3 +0 -197
  65. data/vendor/liburing/man/io_uring_prep_accept_direct.3 +0 -1
  66. data/vendor/liburing/man/io_uring_prep_cancel.3 +0 -118
  67. data/vendor/liburing/man/io_uring_prep_cancel64.3 +0 -1
  68. data/vendor/liburing/man/io_uring_prep_close.3 +0 -59
  69. data/vendor/liburing/man/io_uring_prep_close_direct.3 +0 -1
  70. data/vendor/liburing/man/io_uring_prep_connect.3 +0 -66
  71. data/vendor/liburing/man/io_uring_prep_fadvise.3 +0 -59
  72. data/vendor/liburing/man/io_uring_prep_fallocate.3 +0 -59
  73. data/vendor/liburing/man/io_uring_prep_fgetxattr.3 +0 -1
  74. data/vendor/liburing/man/io_uring_prep_files_update.3 +0 -92
  75. data/vendor/liburing/man/io_uring_prep_fsetxattr.3 +0 -1
  76. data/vendor/liburing/man/io_uring_prep_fsync.3 +0 -70
  77. data/vendor/liburing/man/io_uring_prep_getxattr.3 +0 -61
  78. data/vendor/liburing/man/io_uring_prep_link.3 +0 -1
  79. data/vendor/liburing/man/io_uring_prep_link_timeout.3 +0 -94
  80. data/vendor/liburing/man/io_uring_prep_linkat.3 +0 -91
  81. data/vendor/liburing/man/io_uring_prep_madvise.3 +0 -56
  82. data/vendor/liburing/man/io_uring_prep_mkdir.3 +0 -1
  83. data/vendor/liburing/man/io_uring_prep_mkdirat.3 +0 -83
  84. data/vendor/liburing/man/io_uring_prep_msg_ring.3 +0 -92
  85. data/vendor/liburing/man/io_uring_prep_msg_ring_cqe_flags.3 +0 -1
  86. data/vendor/liburing/man/io_uring_prep_multishot_accept.3 +0 -1
  87. data/vendor/liburing/man/io_uring_prep_multishot_accept_direct.3 +0 -1
  88. data/vendor/liburing/man/io_uring_prep_nop.3 +0 -28
  89. data/vendor/liburing/man/io_uring_prep_openat.3 +0 -117
  90. data/vendor/liburing/man/io_uring_prep_openat2.3 +0 -117
  91. data/vendor/liburing/man/io_uring_prep_openat2_direct.3 +0 -1
  92. data/vendor/liburing/man/io_uring_prep_openat_direct.3 +0 -1
  93. data/vendor/liburing/man/io_uring_prep_poll_add.3 +0 -72
  94. data/vendor/liburing/man/io_uring_prep_poll_multishot.3 +0 -1
  95. data/vendor/liburing/man/io_uring_prep_poll_remove.3 +0 -55
  96. data/vendor/liburing/man/io_uring_prep_poll_update.3 +0 -89
  97. data/vendor/liburing/man/io_uring_prep_provide_buffers.3 +0 -140
  98. data/vendor/liburing/man/io_uring_prep_read.3 +0 -69
  99. data/vendor/liburing/man/io_uring_prep_read_fixed.3 +0 -72
  100. data/vendor/liburing/man/io_uring_prep_readv.3 +0 -85
  101. data/vendor/liburing/man/io_uring_prep_readv2.3 +0 -111
  102. data/vendor/liburing/man/io_uring_prep_recv.3 +0 -105
  103. data/vendor/liburing/man/io_uring_prep_recv_multishot.3 +0 -1
  104. data/vendor/liburing/man/io_uring_prep_recvmsg.3 +0 -124
  105. data/vendor/liburing/man/io_uring_prep_recvmsg_multishot.3 +0 -1
  106. data/vendor/liburing/man/io_uring_prep_remove_buffers.3 +0 -52
  107. data/vendor/liburing/man/io_uring_prep_rename.3 +0 -1
  108. data/vendor/liburing/man/io_uring_prep_renameat.3 +0 -96
  109. data/vendor/liburing/man/io_uring_prep_send.3 +0 -66
  110. data/vendor/liburing/man/io_uring_prep_send_set_addr.3 +0 -38
  111. data/vendor/liburing/man/io_uring_prep_send_zc.3 +0 -96
  112. data/vendor/liburing/man/io_uring_prep_send_zc_fixed.3 +0 -1
  113. data/vendor/liburing/man/io_uring_prep_sendmsg.3 +0 -89
  114. data/vendor/liburing/man/io_uring_prep_sendmsg_zc.3 +0 -1
  115. data/vendor/liburing/man/io_uring_prep_setxattr.3 +0 -64
  116. data/vendor/liburing/man/io_uring_prep_shutdown.3 +0 -53
  117. data/vendor/liburing/man/io_uring_prep_socket.3 +0 -118
  118. data/vendor/liburing/man/io_uring_prep_socket_direct.3 +0 -1
  119. data/vendor/liburing/man/io_uring_prep_socket_direct_alloc.3 +0 -1
  120. data/vendor/liburing/man/io_uring_prep_splice.3 +0 -120
  121. data/vendor/liburing/man/io_uring_prep_statx.3 +0 -74
  122. data/vendor/liburing/man/io_uring_prep_symlink.3 +0 -1
  123. data/vendor/liburing/man/io_uring_prep_symlinkat.3 +0 -85
  124. data/vendor/liburing/man/io_uring_prep_sync_file_range.3 +0 -59
  125. data/vendor/liburing/man/io_uring_prep_tee.3 +0 -74
  126. data/vendor/liburing/man/io_uring_prep_timeout.3 +0 -95
  127. data/vendor/liburing/man/io_uring_prep_timeout_remove.3 +0 -1
  128. data/vendor/liburing/man/io_uring_prep_timeout_update.3 +0 -98
  129. data/vendor/liburing/man/io_uring_prep_unlink.3 +0 -1
  130. data/vendor/liburing/man/io_uring_prep_unlinkat.3 +0 -82
  131. data/vendor/liburing/man/io_uring_prep_write.3 +0 -67
  132. data/vendor/liburing/man/io_uring_prep_write_fixed.3 +0 -72
  133. data/vendor/liburing/man/io_uring_prep_writev.3 +0 -85
  134. data/vendor/liburing/man/io_uring_prep_writev2.3 +0 -111
  135. data/vendor/liburing/man/io_uring_queue_exit.3 +0 -26
  136. data/vendor/liburing/man/io_uring_queue_init.3 +0 -89
  137. data/vendor/liburing/man/io_uring_queue_init_params.3 +0 -1
  138. data/vendor/liburing/man/io_uring_recvmsg_cmsg_firsthdr.3 +0 -1
  139. data/vendor/liburing/man/io_uring_recvmsg_cmsg_nexthdr.3 +0 -1
  140. data/vendor/liburing/man/io_uring_recvmsg_name.3 +0 -1
  141. data/vendor/liburing/man/io_uring_recvmsg_out.3 +0 -82
  142. data/vendor/liburing/man/io_uring_recvmsg_payload.3 +0 -1
  143. data/vendor/liburing/man/io_uring_recvmsg_payload_length.3 +0 -1
  144. data/vendor/liburing/man/io_uring_recvmsg_validate.3 +0 -1
  145. data/vendor/liburing/man/io_uring_register.2 +0 -834
  146. data/vendor/liburing/man/io_uring_register_buf_ring.3 +0 -140
  147. data/vendor/liburing/man/io_uring_register_buffers.3 +0 -104
  148. data/vendor/liburing/man/io_uring_register_buffers_sparse.3 +0 -1
  149. data/vendor/liburing/man/io_uring_register_buffers_tags.3 +0 -1
  150. data/vendor/liburing/man/io_uring_register_buffers_update_tag.3 +0 -1
  151. data/vendor/liburing/man/io_uring_register_eventfd.3 +0 -51
  152. data/vendor/liburing/man/io_uring_register_eventfd_async.3 +0 -1
  153. data/vendor/liburing/man/io_uring_register_file_alloc_range.3 +0 -52
  154. data/vendor/liburing/man/io_uring_register_files.3 +0 -112
  155. data/vendor/liburing/man/io_uring_register_files_sparse.3 +0 -1
  156. data/vendor/liburing/man/io_uring_register_files_tags.3 +0 -1
  157. data/vendor/liburing/man/io_uring_register_files_update.3 +0 -1
  158. data/vendor/liburing/man/io_uring_register_files_update_tag.3 +0 -1
  159. data/vendor/liburing/man/io_uring_register_iowq_aff.3 +0 -61
  160. data/vendor/liburing/man/io_uring_register_iowq_max_workers.3 +0 -71
  161. data/vendor/liburing/man/io_uring_register_ring_fd.3 +0 -49
  162. data/vendor/liburing/man/io_uring_register_sync_cancel.3 +0 -71
  163. data/vendor/liburing/man/io_uring_setup.2 +0 -669
  164. data/vendor/liburing/man/io_uring_sq_ready.3 +0 -31
  165. data/vendor/liburing/man/io_uring_sq_space_left.3 +0 -25
  166. data/vendor/liburing/man/io_uring_sqe_set_data.3 +0 -48
  167. data/vendor/liburing/man/io_uring_sqe_set_data64.3 +0 -1
  168. data/vendor/liburing/man/io_uring_sqe_set_flags.3 +0 -87
  169. data/vendor/liburing/man/io_uring_sqring_wait.3 +0 -34
  170. data/vendor/liburing/man/io_uring_submit.3 +0 -46
  171. data/vendor/liburing/man/io_uring_submit_and_get_events.3 +0 -31
  172. data/vendor/liburing/man/io_uring_submit_and_wait.3 +0 -38
  173. data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +0 -56
  174. data/vendor/liburing/man/io_uring_unregister_buf_ring.3 +0 -30
  175. data/vendor/liburing/man/io_uring_unregister_buffers.3 +0 -27
  176. data/vendor/liburing/man/io_uring_unregister_eventfd.3 +0 -1
  177. data/vendor/liburing/man/io_uring_unregister_files.3 +0 -27
  178. data/vendor/liburing/man/io_uring_unregister_iowq_aff.3 +0 -1
  179. data/vendor/liburing/man/io_uring_unregister_ring_fd.3 +0 -32
  180. data/vendor/liburing/man/io_uring_wait_cqe.3 +0 -40
  181. data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +0 -43
  182. data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +0 -53
  183. data/vendor/liburing/man/io_uring_wait_cqes.3 +0 -56
@@ -1,118 +0,0 @@
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_socket 3 "May 27, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_prep_socket \- prepare a socket creation 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_socket(struct io_uring_sqe *" sqe ","
14
- .BI " int " domain ","
15
- .BI " int " type ","
16
- .BI " int " protocol ","
17
- .BI " unsigned int " flags ");"
18
- .PP
19
- .BI "void io_uring_prep_socket_direct(struct io_uring_sqe *" sqe ","
20
- .BI " int " domain ","
21
- .BI " int " type ","
22
- .BI " int " protocol ","
23
- .BI " unsigned int " file_index ","
24
- .BI " unsigned int " flags ");"
25
- .PP
26
- .BI "void io_uring_prep_socket_direct_alloc(struct io_uring_sqe *" sqe ","
27
- .BI " int " domain ","
28
- .BI " int " type ","
29
- .BI " int " protocol ","
30
- .BI " unsigned int " flags ");"
31
- .fi
32
- .SH DESCRIPTION
33
- .PP
34
- The
35
- .BR io_uring_prep_socket (3)
36
- function prepares a socket creation request. The submission queue entry
37
- .I sqe
38
- is setup to use the communication domain defined by
39
- .I domain
40
- and use the communication type defined by
41
- .I type
42
- and the protocol set by
43
- .IR protocol .
44
- The
45
- .I flags
46
- argument are currently unused.
47
-
48
- The
49
- .BR io_uring_prep_socket_direct (3)
50
- helper works just like
51
- .BR io_uring_prep_socket (3),
52
- except it maps the socket to a direct descriptor rather than return a normal
53
- file descriptor. The
54
- .I file_index
55
- argument should be set to the slot that should be used for this socket.
56
-
57
- The
58
- .BR io_uring_prep_socket_direct_alloc (3)
59
- helper works just like
60
- .BR io_uring_prep_socket_alloc (3),
61
- except it allocates a new direct descriptor rather than pass a free slot in. It
62
- is equivalent to using
63
- .BR io_uring_prep_socket_direct (3)
64
- with
65
- .B IORING_FILE_INDEX_ALLOC
66
- as the
67
- .I
68
- file_index .
69
- Upon completion, the
70
- .I res
71
- field of the CQE will return the direct slot that was allocated for the
72
- socket.
73
-
74
- If the direct variants are used, the application must first have registered
75
- a file table using
76
- .BR io_uring_register_files (3)
77
- of the appropriate size. Once registered, a direct socket request may use any
78
- entry in that table, as long as it is within the size of the registered table.
79
- If a specified entry already contains a file, the file will first be removed
80
- from the table and closed. It's consistent with the behavior of updating an
81
- existing file with
82
- .BR io_uring_register_files_update (3).
83
-
84
- For a direct descriptor socket request, the
85
- .I file_index
86
- argument can be set to
87
- .BR IORING_FILE_INDEX_ALLOC ,
88
- In this case a free entry in io_uring file table will
89
- be used automatically and the file index will be returned as CQE
90
- .IR res .
91
- .B -ENFILE
92
- is otherwise returned if there is no free entries in the io_uring file table.
93
-
94
- These functions prepare an async
95
- .BR socket (2)
96
- request. See that man page for details.
97
-
98
- .SH RETURN VALUE
99
- None
100
- .SH ERRORS
101
- The CQE
102
- .I res
103
- field will contain the result of the operation. See the related man page for
104
- details on possible values. Note that where synchronous system calls will return
105
- .B -1
106
- on failure and set
107
- .I errno
108
- to the actual error value, io_uring never uses
109
- .IR errno .
110
- Instead it returns the negated
111
- .I errno
112
- directly in the CQE
113
- .I res
114
- field.
115
- .SH SEE ALSO
116
- .BR io_uring_get_sqe (3),
117
- .BR io_uring_submit (3),
118
- .BR socket (2)
@@ -1 +0,0 @@
1
- io_uring_prep_socket.3
@@ -1 +0,0 @@
1
- io_uring_prep_socket.3
@@ -1,120 +0,0 @@
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_splice 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_prep_splice \- prepare an splice request
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <fcntl.h>
11
- .B #include <liburing.h>
12
- .PP
13
- .BI "void io_uring_prep_splice(struct io_uring_sqe *" sqe ","
14
- .BI " int " fd_in ","
15
- .BI " int64_t " off_in ","
16
- .BI " int " fd_out ","
17
- .BI " int64_t " off_out ","
18
- .BI " unsigned int " nbytes ","
19
- .BI " unsigned int " splice_flags ");"
20
- .fi
21
- .SH DESCRIPTION
22
- .PP
23
- The
24
- .BR io_uring_prep_splice (3)
25
- function prepares a splice request. The submission queue entry
26
- .I sqe
27
- is setup to use as input the file descriptor
28
- .I fd_in
29
- at offset
30
- .IR off_in ,
31
- splicing data to the file descriptor at
32
- .I fd_out
33
- and at offset
34
- .IR off_out .
35
- .I nbytes
36
- bytes of data should be spliced between the two descriptors.
37
- .I splice_flags
38
- are modifier flags for the operation. See
39
- .BR splice (2)
40
- for the generic splice flags.
41
-
42
- If the
43
- .I fd_out
44
- descriptor,
45
- .B IOSQE_FIXED_FILE
46
- can be set in the SQE to indicate that. For the input file, the io_uring
47
- specific
48
- .B SPLICE_F_FD_IN_FIXED
49
- can be set in
50
- .I splice_flags
51
- and
52
- .I fd_in
53
- given as a registered file descriptor offset.
54
-
55
- If
56
- .I fd_in
57
- refers to a pipe,
58
- .I off_in
59
- is ignored and must be set to -1.
60
-
61
- If
62
- .I fd_in
63
- does not refer to a pipe and
64
- .I off_in
65
- is -1, then
66
- .I nbytes
67
- are read from
68
- .I fd_in
69
- starting from the file offset, which is incremented by the number of bytes read.
70
-
71
- If
72
- .I fd_in
73
- does not refer to a pipe and
74
- .I off_in
75
- is not -1, then the starting offset of
76
- .I fd_in
77
- will be
78
- .IR off_in .
79
-
80
- The same rules apply to
81
- .I fd_out
82
- and
83
- .IR off_out .
84
-
85
- This function prepares an async
86
- .BR splice (2)
87
- request. See that man page for details.
88
-
89
- .SH RETURN VALUE
90
- None
91
- .SH ERRORS
92
- The CQE
93
- .I res
94
- field will contain the result of the operation. See the related man page for
95
- details on possible values. Note that where synchronous system calls will return
96
- .B -1
97
- on failure and set
98
- .I errno
99
- to the actual error value, io_uring never uses
100
- .IR errno .
101
- Instead it returns the negated
102
- .I errno
103
- directly in the CQE
104
- .I res
105
- field.
106
- .SH SEE ALSO
107
- .BR io_uring_get_sqe (3),
108
- .BR io_uring_submit (3),
109
- .BR io_uring_register (2),
110
- .BR splice (2)
111
-
112
- .SH NOTES
113
- Note that even if
114
- .I fd_in
115
- or
116
- .I fd_out
117
- refers to a pipe, the splice operation can still fail with
118
- .B EINVAL
119
- if one of the fd doesn't explicitly support splice operation, e.g. reading from
120
- terminal is unsupported from kernel 5.7 to 5.11.
@@ -1,74 +0,0 @@
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_statx 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_prep_statx \- prepare a statx request
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <sys/types.h>
11
- .B #include <sys/stat.h>
12
- .B #include <unistd.h>
13
- .B #include <fcntl.h>
14
- .B #include <liburing.h>
15
- .PP
16
- .BI "void io_uring_prep_statx(struct io_uring_sqe *" sqe ","
17
- .BI " int " dirfd ","
18
- .BI " const char *" path ","
19
- .BI " int " flags ","
20
- .BI " unsigned " mask ","
21
- .BI " struct statx *" statxbuf ");"
22
- .fi
23
- .SH DESCRIPTION
24
- .PP
25
- The
26
- .BR io_uring_prep_statx (3)
27
- function prepares a statx 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 a statx operation on the path identified by
32
- .I path
33
- and using the flags given in
34
- .I flags
35
- for the fields specified by
36
- .I mask
37
- and into the buffer located at
38
- .IR statxbuf .
39
-
40
- This function prepares an async
41
- .BR statx (2)
42
- request. See that man page for details.
43
-
44
- .SH RETURN VALUE
45
- None
46
- .SH ERRORS
47
- The CQE
48
- .I res
49
- field will contain the result of the operation. See the related man page for
50
- details on possible values. Note that where synchronous system calls will return
51
- .B -1
52
- on failure and set
53
- .I errno
54
- to the actual error value, io_uring never uses
55
- .IR errno .
56
- Instead it returns the negated
57
- .I errno
58
- directly in the CQE
59
- .I res
60
- field.
61
- .SH NOTES
62
- As with any request that passes in data in a struct, that data must remain
63
- valid until the request has been successfully submitted. It need not remain
64
- valid until completion. Once a request has been submitted, the in-kernel
65
- state is stable. Very early kernels (5.4 and earlier) required state to be
66
- stable until the completion occurred. Applications can test for this
67
- behavior by inspecting the
68
- .B IORING_FEAT_SUBMIT_STABLE
69
- flag passed back from
70
- .BR io_uring_queue_init_params (3).
71
- .SH SEE ALSO
72
- .BR io_uring_get_sqe (3),
73
- .BR io_uring_submit (3),
74
- .BR statx (2)
@@ -1 +0,0 @@
1
- io_uring_prep_symlinkat.3
@@ -1,85 +0,0 @@
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_symlinkat 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_prep_symlinkat \- prepare a symlinkat 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_symlinkat(struct io_uring_sqe *" sqe ","
15
- .BI " const char *" target ","
16
- .BI " int " newdirfd ","
17
- .BI " const char *" linkpath ");"
18
- .PP
19
- .BI "void io_uring_prep_symlink(struct io_uring_sqe *" sqe ","
20
- .BI " const char *" target ","
21
- .BI " const char *" linkpath ");"
22
- .fi
23
- .SH DESCRIPTION
24
- .PP
25
- The
26
- .BR io_uring_prep_symlinkat (3)
27
- function prepares a symlinkat request. The submission queue entry
28
- .I sqe
29
- is setup to symlink the target path pointed to by
30
- .I target
31
- to the new destination indicated by
32
- .I newdirfd
33
- and
34
- .IR linkpath .
35
-
36
- The
37
- .BR io_uring_prep_symlink (3)
38
- function prepares a symlink request. The submission queue entry
39
- .I sqe
40
- is setup to symlink the target path pointed to by
41
- .I target
42
- to the new destination indicated by
43
- .I linkpath
44
- relative to the the current working directory. This function prepares an async
45
- .BR symlink (2)
46
- request. See that man page for details.
47
-
48
- These functions prepare an async
49
- .BR symlinkat (2)
50
- or
51
- .BR symlink (2)
52
- request. See those man pages for details.
53
-
54
- .SH RETURN VALUE
55
- None
56
- .SH ERRORS
57
- The CQE
58
- .I res
59
- field will contain the result of the operation. See the related man page for
60
- details on possible values. Note that where synchronous system calls will return
61
- .B -1
62
- on failure and set
63
- .I errno
64
- to the actual error value, io_uring never uses
65
- .IR errno .
66
- Instead it returns the negated
67
- .I errno
68
- directly in the CQE
69
- .I res
70
- field.
71
- .SH NOTES
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).
81
- .SH SEE ALSO
82
- .BR io_uring_get_sqe (3),
83
- .BR io_uring_submit (3),
84
- .BR symlinkat (2),
85
- .BR symlink (2)
@@ -1,59 +0,0 @@
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_sync_file_range 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_prep_sync_file_range \- prepare a sync_file_range request
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <fcntl.h>
11
- .B #include <liburing.h>
12
- .PP
13
- .BI "void io_uring_prep_sync_file_range(struct io_uring_sqe *" sqe ","
14
- .BI " int " fd ","
15
- .BI " unsigned " len ","
16
- .BI " __u64 " offset ","
17
- .BI " int " flags ");"
18
- .fi
19
- .SH DESCRIPTION
20
- .PP
21
- The
22
- .BR io_uring_prep_sync_file_range (3)
23
- function prepares a sync_file_range request. The submission queue entry
24
- .I sqe
25
- is setup to use the file descriptor
26
- .I fd
27
- that should get
28
- .I len
29
- bytes synced started at offset
30
- .I offset
31
- and with modifier flags in the
32
- .I flags
33
- argument.
34
-
35
- This function prepares an async
36
- .BR sync_file_range (2)
37
- request. See that man page for details on the arguments.
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 sync_file_range (2)
@@ -1,74 +0,0 @@
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)
@@ -1,95 +0,0 @@
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)
@@ -1 +0,0 @@
1
- io_uring_prep_timeout_update.3