polyphony 0.94 → 0.95

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +2 -2
  3. data/.gitignore +3 -3
  4. data/CHANGELOG.md +14 -0
  5. data/docs/api-reference/fiber.md +2 -2
  6. data/docs/api-reference/object.md +3 -3
  7. data/docs/main-concepts/exception-handling.md +2 -2
  8. data/ext/polyphony/backend_common.c +3 -3
  9. data/ext/polyphony/backend_io_uring.c +18 -16
  10. data/ext/polyphony/event.c +1 -1
  11. data/ext/polyphony/extconf.rb +5 -3
  12. data/ext/polyphony/fiber.c +5 -13
  13. data/ext/polyphony/io_extensions.c +1 -1
  14. data/ext/polyphony/pipe.c +1 -1
  15. data/ext/polyphony/polyphony.c +1 -1
  16. data/ext/polyphony/polyphony_ext.c +1 -1
  17. data/ext/polyphony/queue.c +1 -1
  18. data/ext/polyphony/ring_buffer.c +1 -0
  19. data/ext/polyphony/socket_extensions.c +1 -1
  20. data/ext/polyphony/thread.c +1 -1
  21. data/lib/polyphony/extensions/enumerator.rb +16 -0
  22. data/lib/polyphony/extensions/socket.rb +2 -0
  23. data/lib/polyphony/extensions.rb +1 -0
  24. data/lib/polyphony/version.rb +1 -1
  25. data/polyphony.gemspec +2 -2
  26. data/test/test_backend.rb +5 -1
  27. data/test/test_enumerator.rb +46 -0
  28. data/test/test_io.rb +241 -216
  29. data/test/test_socket.rb +1 -1
  30. data/test/test_thread_pool.rb +3 -3
  31. data/vendor/liburing/.github/workflows/build.yml +51 -5
  32. data/vendor/liburing/.github/workflows/shellcheck.yml +1 -1
  33. data/vendor/liburing/.gitignore +6 -123
  34. data/vendor/liburing/CHANGELOG +35 -0
  35. data/vendor/liburing/CITATION.cff +11 -0
  36. data/vendor/liburing/LICENSE +16 -3
  37. data/vendor/liburing/Makefile +3 -1
  38. data/vendor/liburing/Makefile.common +1 -0
  39. data/vendor/liburing/README +14 -2
  40. data/vendor/liburing/SECURITY.md +6 -0
  41. data/vendor/liburing/configure +16 -15
  42. data/vendor/liburing/examples/Makefile +4 -1
  43. data/vendor/liburing/examples/io_uring-udp.c +395 -0
  44. data/vendor/liburing/examples/poll-bench.c +101 -0
  45. data/vendor/liburing/examples/send-zerocopy.c +339 -0
  46. data/vendor/liburing/liburing.spec +1 -1
  47. data/vendor/liburing/man/io_uring.7 +38 -11
  48. data/vendor/liburing/man/io_uring_buf_ring_add.3 +53 -0
  49. data/vendor/liburing/man/io_uring_buf_ring_advance.3 +31 -0
  50. data/vendor/liburing/man/io_uring_buf_ring_cq_advance.3 +41 -0
  51. data/vendor/liburing/man/io_uring_buf_ring_init.3 +30 -0
  52. data/vendor/liburing/man/io_uring_buf_ring_mask.3 +27 -0
  53. data/vendor/liburing/man/io_uring_cq_advance.3 +29 -15
  54. data/vendor/liburing/man/io_uring_cq_has_overflow.3 +25 -0
  55. data/vendor/liburing/man/io_uring_cq_ready.3 +9 -8
  56. data/vendor/liburing/man/io_uring_cqe_get_data.3 +32 -13
  57. data/vendor/liburing/man/io_uring_cqe_get_data64.3 +1 -0
  58. data/vendor/liburing/man/io_uring_cqe_seen.3 +22 -12
  59. data/vendor/liburing/man/io_uring_enter.2 +249 -32
  60. data/vendor/liburing/man/io_uring_enter2.2 +1 -0
  61. data/vendor/liburing/man/io_uring_free_probe.3 +11 -8
  62. data/vendor/liburing/man/io_uring_get_events.3 +33 -0
  63. data/vendor/liburing/man/io_uring_get_probe.3 +9 -8
  64. data/vendor/liburing/man/io_uring_get_sqe.3 +29 -10
  65. data/vendor/liburing/man/io_uring_opcode_supported.3 +11 -10
  66. data/vendor/liburing/man/io_uring_peek_cqe.3 +38 -0
  67. data/vendor/liburing/man/io_uring_prep_accept.3 +197 -0
  68. data/vendor/liburing/man/io_uring_prep_accept_direct.3 +1 -0
  69. data/vendor/liburing/man/io_uring_prep_cancel.3 +118 -0
  70. data/vendor/liburing/man/io_uring_prep_cancel64.3 +1 -0
  71. data/vendor/liburing/man/io_uring_prep_close.3 +59 -0
  72. data/vendor/liburing/man/io_uring_prep_close_direct.3 +1 -0
  73. data/vendor/liburing/man/io_uring_prep_connect.3 +66 -0
  74. data/vendor/liburing/man/io_uring_prep_fadvise.3 +59 -0
  75. data/vendor/liburing/man/io_uring_prep_fallocate.3 +59 -0
  76. data/vendor/liburing/man/io_uring_prep_files_update.3 +92 -0
  77. data/vendor/liburing/man/io_uring_prep_fsync.3 +70 -0
  78. data/vendor/liburing/man/io_uring_prep_link.3 +1 -0
  79. data/vendor/liburing/man/io_uring_prep_linkat.3 +91 -0
  80. data/vendor/liburing/man/io_uring_prep_madvise.3 +56 -0
  81. data/vendor/liburing/man/io_uring_prep_mkdir.3 +1 -0
  82. data/vendor/liburing/man/io_uring_prep_mkdirat.3 +83 -0
  83. data/vendor/liburing/man/io_uring_prep_msg_ring.3 +39 -25
  84. data/vendor/liburing/man/io_uring_prep_multishot_accept.3 +1 -0
  85. data/vendor/liburing/man/io_uring_prep_multishot_accept_direct.3 +1 -0
  86. data/vendor/liburing/man/io_uring_prep_nop.3 +28 -0
  87. data/vendor/liburing/man/io_uring_prep_openat.3 +117 -0
  88. data/vendor/liburing/man/io_uring_prep_openat2.3 +117 -0
  89. data/vendor/liburing/man/io_uring_prep_openat2_direct.3 +1 -0
  90. data/vendor/liburing/man/io_uring_prep_openat_direct.3 +1 -0
  91. data/vendor/liburing/man/io_uring_prep_poll_add.3 +72 -0
  92. data/vendor/liburing/man/io_uring_prep_poll_multishot.3 +1 -0
  93. data/vendor/liburing/man/io_uring_prep_poll_remove.3 +55 -0
  94. data/vendor/liburing/man/io_uring_prep_poll_update.3 +89 -0
  95. data/vendor/liburing/man/io_uring_prep_provide_buffers.3 +131 -0
  96. data/vendor/liburing/man/io_uring_prep_read.3 +33 -14
  97. data/vendor/liburing/man/io_uring_prep_read_fixed.3 +39 -21
  98. data/vendor/liburing/man/io_uring_prep_readv.3 +49 -15
  99. data/vendor/liburing/man/io_uring_prep_readv2.3 +49 -17
  100. data/vendor/liburing/man/io_uring_prep_recv.3 +105 -0
  101. data/vendor/liburing/man/io_uring_prep_recv_multishot.3 +1 -0
  102. data/vendor/liburing/man/io_uring_prep_recvmsg.3 +124 -0
  103. data/vendor/liburing/man/io_uring_prep_recvmsg_multishot.3 +1 -0
  104. data/vendor/liburing/man/io_uring_prep_remove_buffers.3 +52 -0
  105. data/vendor/liburing/man/io_uring_prep_rename.3 +1 -0
  106. data/vendor/liburing/man/io_uring_prep_renameat.3 +96 -0
  107. data/vendor/liburing/man/io_uring_prep_send.3 +57 -0
  108. data/vendor/liburing/man/io_uring_prep_send_zc.3 +64 -0
  109. data/vendor/liburing/man/io_uring_prep_sendmsg.3 +69 -0
  110. data/vendor/liburing/man/io_uring_prep_shutdown.3 +53 -0
  111. data/vendor/liburing/man/io_uring_prep_socket.3 +118 -0
  112. data/vendor/liburing/man/io_uring_prep_socket_direct.3 +1 -0
  113. data/vendor/liburing/man/io_uring_prep_socket_direct_alloc.3 +1 -0
  114. data/vendor/liburing/man/io_uring_prep_splice.3 +80 -0
  115. data/vendor/liburing/man/io_uring_prep_statx.3 +74 -0
  116. data/vendor/liburing/man/io_uring_prep_symlink.3 +1 -0
  117. data/vendor/liburing/man/io_uring_prep_symlinkat.3 +85 -0
  118. data/vendor/liburing/man/io_uring_prep_sync_file_range.3 +59 -0
  119. data/vendor/liburing/man/io_uring_prep_tee.3 +74 -0
  120. data/vendor/liburing/man/io_uring_prep_timeout.3 +95 -0
  121. data/vendor/liburing/man/io_uring_prep_timeout_remove.3 +1 -0
  122. data/vendor/liburing/man/io_uring_prep_timeout_update.3 +98 -0
  123. data/vendor/liburing/man/io_uring_prep_unlink.3 +1 -0
  124. data/vendor/liburing/man/io_uring_prep_unlinkat.3 +82 -0
  125. data/vendor/liburing/man/io_uring_prep_write.3 +32 -15
  126. data/vendor/liburing/man/io_uring_prep_write_fixed.3 +39 -21
  127. data/vendor/liburing/man/io_uring_prep_writev.3 +50 -16
  128. data/vendor/liburing/man/io_uring_prep_writev2.3 +50 -17
  129. data/vendor/liburing/man/io_uring_queue_exit.3 +3 -4
  130. data/vendor/liburing/man/io_uring_queue_init.3 +58 -13
  131. data/vendor/liburing/man/io_uring_queue_init_params.3 +1 -0
  132. data/vendor/liburing/man/io_uring_recvmsg_cmsg_firsthdr.3 +1 -0
  133. data/vendor/liburing/man/io_uring_recvmsg_cmsg_nexthdr.3 +1 -0
  134. data/vendor/liburing/man/io_uring_recvmsg_name.3 +1 -0
  135. data/vendor/liburing/man/io_uring_recvmsg_out.3 +78 -0
  136. data/vendor/liburing/man/io_uring_recvmsg_payload.3 +1 -0
  137. data/vendor/liburing/man/io_uring_recvmsg_payload_length.3 +1 -0
  138. data/vendor/liburing/man/io_uring_recvmsg_validate.3 +1 -0
  139. data/vendor/liburing/man/io_uring_register.2 +153 -13
  140. data/vendor/liburing/man/io_uring_register_buf_ring.3 +140 -0
  141. data/vendor/liburing/man/io_uring_register_buffers.3 +32 -12
  142. data/vendor/liburing/man/io_uring_register_eventfd.3 +51 -0
  143. data/vendor/liburing/man/io_uring_register_eventfd_async.3 +1 -0
  144. data/vendor/liburing/man/io_uring_register_file_alloc_range.3 +52 -0
  145. data/vendor/liburing/man/io_uring_register_files.3 +33 -11
  146. data/vendor/liburing/man/io_uring_register_files_sparse.3 +1 -0
  147. data/vendor/liburing/man/io_uring_register_iowq_aff.3 +61 -0
  148. data/vendor/liburing/man/io_uring_register_iowq_max_workers.3 +71 -0
  149. data/vendor/liburing/man/io_uring_register_ring_fd.3 +49 -0
  150. data/vendor/liburing/man/io_uring_register_sync_cancel.3 +71 -0
  151. data/vendor/liburing/man/io_uring_setup.2 +119 -13
  152. data/vendor/liburing/man/io_uring_sq_ready.3 +14 -8
  153. data/vendor/liburing/man/io_uring_sq_space_left.3 +9 -9
  154. data/vendor/liburing/man/io_uring_sqe_set_data.3 +29 -11
  155. data/vendor/liburing/man/io_uring_sqe_set_data64.3 +1 -0
  156. data/vendor/liburing/man/io_uring_sqe_set_flags.3 +38 -11
  157. data/vendor/liburing/man/io_uring_sqring_wait.3 +13 -9
  158. data/vendor/liburing/man/io_uring_submit.3 +29 -12
  159. data/vendor/liburing/man/io_uring_submit_and_get_events.3 +31 -0
  160. data/vendor/liburing/man/io_uring_submit_and_wait.3 +16 -12
  161. data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +30 -23
  162. data/vendor/liburing/man/io_uring_unregister_buf_ring.3 +30 -0
  163. data/vendor/liburing/man/io_uring_unregister_buffers.3 +11 -10
  164. data/vendor/liburing/man/io_uring_unregister_eventfd.3 +1 -0
  165. data/vendor/liburing/man/io_uring_unregister_files.3 +11 -10
  166. data/vendor/liburing/man/io_uring_unregister_iowq_aff.3 +1 -0
  167. data/vendor/liburing/man/io_uring_unregister_ring_fd.3 +32 -0
  168. data/vendor/liburing/man/io_uring_wait_cqe.3 +19 -12
  169. data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +21 -14
  170. data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +27 -13
  171. data/vendor/liburing/man/io_uring_wait_cqes.3 +24 -14
  172. data/vendor/liburing/src/Makefile +8 -7
  173. data/vendor/liburing/src/arch/aarch64/lib.h +48 -0
  174. data/vendor/liburing/src/arch/aarch64/syscall.h +0 -4
  175. data/vendor/liburing/src/arch/generic/lib.h +0 -4
  176. data/vendor/liburing/src/arch/generic/syscall.h +29 -16
  177. data/vendor/liburing/src/arch/syscall-defs.h +41 -14
  178. data/vendor/liburing/src/arch/x86/lib.h +0 -21
  179. data/vendor/liburing/src/arch/x86/syscall.h +146 -10
  180. data/vendor/liburing/src/include/liburing/io_uring.h +245 -5
  181. data/vendor/liburing/src/include/liburing.h +468 -35
  182. data/vendor/liburing/src/int_flags.h +1 -0
  183. data/vendor/liburing/src/lib.h +20 -16
  184. data/vendor/liburing/src/liburing.map +16 -0
  185. data/vendor/liburing/src/nolibc.c +1 -1
  186. data/vendor/liburing/src/queue.c +87 -55
  187. data/vendor/liburing/src/register.c +129 -53
  188. data/vendor/liburing/src/setup.c +65 -28
  189. data/vendor/liburing/src/syscall.c +14 -32
  190. data/vendor/liburing/src/syscall.h +12 -64
  191. data/vendor/liburing/test/{232c93d07b74-test.c → 232c93d07b74.c} +8 -9
  192. data/vendor/liburing/test/{35fa71a030ca-test.c → 35fa71a030ca.c} +4 -4
  193. data/vendor/liburing/test/{500f9fbadef8-test.c → 500f9fbadef8.c} +7 -7
  194. data/vendor/liburing/test/{7ad0e4b2f83c-test.c → 7ad0e4b2f83c.c} +8 -7
  195. data/vendor/liburing/test/{8a9973408177-test.c → 8a9973408177.c} +4 -3
  196. data/vendor/liburing/test/{917257daa0fe-test.c → 917257daa0fe.c} +3 -2
  197. data/vendor/liburing/test/Makefile +60 -62
  198. data/vendor/liburing/test/{a0908ae19763-test.c → a0908ae19763.c} +3 -2
  199. data/vendor/liburing/test/{a4c0b3decb33-test.c → a4c0b3decb33.c} +3 -2
  200. data/vendor/liburing/test/accept-link.c +5 -4
  201. data/vendor/liburing/test/accept-reuse.c +17 -16
  202. data/vendor/liburing/test/accept-test.c +14 -10
  203. data/vendor/liburing/test/accept.c +529 -107
  204. data/vendor/liburing/test/across-fork.c +7 -6
  205. data/vendor/liburing/test/{b19062a56726-test.c → b19062a56726.c} +3 -2
  206. data/vendor/liburing/test/{b5837bd5311d-test.c → b5837bd5311d.c} +10 -9
  207. data/vendor/liburing/test/buf-ring.c +420 -0
  208. data/vendor/liburing/test/{ce593a6c480a-test.c → ce593a6c480a.c} +15 -12
  209. data/vendor/liburing/test/connect.c +8 -7
  210. data/vendor/liburing/test/cq-full.c +5 -4
  211. data/vendor/liburing/test/cq-overflow.c +242 -12
  212. data/vendor/liburing/test/cq-peek-batch.c +5 -4
  213. data/vendor/liburing/test/cq-ready.c +5 -4
  214. data/vendor/liburing/test/cq-size.c +5 -4
  215. data/vendor/liburing/test/{d4ae271dfaae-test.c → d4ae271dfaae.c} +2 -2
  216. data/vendor/liburing/test/{d77a67ed5f27-test.c → d77a67ed5f27.c} +6 -6
  217. data/vendor/liburing/test/defer-taskrun.c +336 -0
  218. data/vendor/liburing/test/defer.c +26 -14
  219. data/vendor/liburing/test/double-poll-crash.c +15 -5
  220. data/vendor/liburing/test/drop-submit.c +5 -3
  221. data/vendor/liburing/test/{eeed8b54e0df-test.c → eeed8b54e0df.c} +7 -6
  222. data/vendor/liburing/test/empty-eownerdead.c +4 -4
  223. data/vendor/liburing/test/eventfd-disable.c +48 -20
  224. data/vendor/liburing/test/eventfd-reg.c +10 -9
  225. data/vendor/liburing/test/eventfd-ring.c +13 -12
  226. data/vendor/liburing/test/eventfd.c +13 -12
  227. data/vendor/liburing/test/exit-no-cleanup.c +1 -1
  228. data/vendor/liburing/test/fadvise.c +3 -3
  229. data/vendor/liburing/test/fallocate.c +16 -9
  230. data/vendor/liburing/test/{fc2a85cb02ef-test.c → fc2a85cb02ef.c} +4 -3
  231. data/vendor/liburing/test/fd-pass.c +187 -0
  232. data/vendor/liburing/test/file-register.c +302 -36
  233. data/vendor/liburing/test/file-update.c +62 -4
  234. data/vendor/liburing/test/file-verify.c +6 -2
  235. data/vendor/liburing/test/files-exit-hang-poll.c +11 -25
  236. data/vendor/liburing/test/files-exit-hang-timeout.c +13 -10
  237. data/vendor/liburing/test/fixed-buf-iter.c +115 -0
  238. data/vendor/liburing/test/fixed-link.c +10 -10
  239. data/vendor/liburing/test/fixed-reuse.c +160 -0
  240. data/vendor/liburing/test/fpos.c +6 -3
  241. data/vendor/liburing/test/fsync.c +3 -3
  242. data/vendor/liburing/test/hardlink.c +10 -6
  243. data/vendor/liburing/test/helpers.c +137 -4
  244. data/vendor/liburing/test/helpers.h +27 -0
  245. data/vendor/liburing/test/io-cancel.c +16 -11
  246. data/vendor/liburing/test/io_uring_enter.c +46 -81
  247. data/vendor/liburing/test/io_uring_passthrough.c +451 -0
  248. data/vendor/liburing/test/io_uring_register.c +59 -229
  249. data/vendor/liburing/test/io_uring_setup.c +24 -29
  250. data/vendor/liburing/test/iopoll-leak.c +85 -0
  251. data/vendor/liburing/test/iopoll.c +16 -9
  252. data/vendor/liburing/test/lfs-openat-write.c +3 -1
  253. data/vendor/liburing/test/link-timeout.c +4 -3
  254. data/vendor/liburing/test/link.c +8 -7
  255. data/vendor/liburing/test/madvise.c +2 -2
  256. data/vendor/liburing/test/mkdir.c +9 -5
  257. data/vendor/liburing/test/msg-ring.c +46 -20
  258. data/vendor/liburing/test/multicqes_drain.c +51 -12
  259. data/vendor/liburing/test/nolibc.c +60 -0
  260. data/vendor/liburing/test/nop.c +78 -16
  261. data/vendor/liburing/test/nvme.h +168 -0
  262. data/vendor/liburing/test/open-direct-link.c +188 -0
  263. data/vendor/liburing/test/open-direct-pick.c +180 -0
  264. data/vendor/liburing/test/openat2.c +3 -3
  265. data/vendor/liburing/test/poll-cancel-all.c +472 -0
  266. data/vendor/liburing/test/poll-link.c +9 -18
  267. data/vendor/liburing/test/poll-mshot-overflow.c +162 -0
  268. data/vendor/liburing/test/poll-mshot-update.c +83 -33
  269. data/vendor/liburing/test/pollfree.c +2 -2
  270. data/vendor/liburing/test/read-before-exit.c +112 -0
  271. data/vendor/liburing/test/read-write.c +83 -1
  272. data/vendor/liburing/test/recv-msgall-stream.c +398 -0
  273. data/vendor/liburing/test/recv-msgall.c +265 -0
  274. data/vendor/liburing/test/recv-multishot.c +505 -0
  275. data/vendor/liburing/test/rename.c +2 -5
  276. data/vendor/liburing/test/ring-leak.c +97 -0
  277. data/vendor/liburing/test/ringbuf-read.c +200 -0
  278. data/vendor/liburing/test/rsrc_tags.c +25 -13
  279. data/vendor/liburing/test/runtests-quiet.sh +11 -0
  280. data/vendor/liburing/test/runtests.sh +18 -20
  281. data/vendor/liburing/test/rw_merge_test.c +3 -2
  282. data/vendor/liburing/test/send-zerocopy.c +684 -0
  283. data/vendor/liburing/test/send_recv.c +49 -2
  284. data/vendor/liburing/test/send_recvmsg.c +165 -55
  285. data/vendor/liburing/test/shutdown.c +3 -4
  286. data/vendor/liburing/test/sigfd-deadlock.c +22 -8
  287. data/vendor/liburing/test/single-issuer.c +171 -0
  288. data/vendor/liburing/test/socket-rw-eagain.c +2 -12
  289. data/vendor/liburing/test/socket-rw-offset.c +2 -11
  290. data/vendor/liburing/test/socket-rw.c +2 -11
  291. data/vendor/liburing/test/socket.c +409 -0
  292. data/vendor/liburing/test/sq-poll-dup.c +1 -1
  293. data/vendor/liburing/test/sq-poll-share.c +1 -1
  294. data/vendor/liburing/test/statx.c +2 -2
  295. data/vendor/liburing/test/submit-and-wait.c +108 -0
  296. data/vendor/liburing/test/submit-link-fail.c +5 -3
  297. data/vendor/liburing/test/submit-reuse.c +0 -2
  298. data/vendor/liburing/test/sync-cancel.c +235 -0
  299. data/vendor/liburing/test/test.h +35 -0
  300. data/vendor/liburing/test/timeout-overflow.c +11 -11
  301. data/vendor/liburing/test/timeout.c +7 -7
  302. data/vendor/liburing/test/tty-write-dpoll.c +60 -0
  303. data/vendor/liburing/test/unlink.c +1 -1
  304. data/vendor/liburing/test/xattr.c +425 -0
  305. metadata +143 -22
  306. data/Gemfile.lock +0 -78
@@ -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_fadvise 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_fadvise \- prepare a fadvise request
8
+ .SH SYNOPSIS
9
+ .nf
10
+ .B #include <fcntl.h>
11
+ .B #include <liburing.h>
12
+ .PP
13
+ .BI "void io_uring_prep_fadvise(struct io_uring_sqe *" sqe ","
14
+ .BI " int " fd ","
15
+ .BI " __u64 " offset ","
16
+ .BI " off_t " len ","
17
+ .BI " int " advice ");"
18
+ .fi
19
+ .SH DESCRIPTION
20
+ .PP
21
+ The
22
+ .BR io_uring_prep_fadvise (3)
23
+ function prepares an fadvise request. The submission queue entry
24
+ .I sqe
25
+ is setup to use the file descriptor pointed to by
26
+ .I fd
27
+ to start an fadvise operation at
28
+ .I offset
29
+ and of
30
+ .I len
31
+ length in bytes, giving it the advise located in
32
+ .IR advice .
33
+
34
+ This function prepares an async
35
+ .BR posix_fadvise (2)
36
+ request. See that man page for details.
37
+
38
+ .SH RETURN VALUE
39
+ None
40
+ .SH ERRORS
41
+ The CQE
42
+ .I res
43
+ field will contain the result of the operation. See the related man page for
44
+ details on possible values. Note that where synchronous system calls will return
45
+ .B -1
46
+ on failure and set
47
+ .I errno
48
+ to the actual error value, io_uring never uses
49
+ .IR errno .
50
+ Instead it returns the negated
51
+ .I errno
52
+ directly in the CQE
53
+ .I res
54
+ field.
55
+ .SH SEE ALSO
56
+ .BR io_uring_get_sqe (3),
57
+ .BR io_uring_submit (3),
58
+ .BR io_uring_register (2),
59
+ .BR posix_fadvise (2)
@@ -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_fallocate 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_fallocate \- prepare a fallocate request
8
+ .SH SYNOPSIS
9
+ .nf
10
+ .B #include <fcntl.h>
11
+ .B #include <liburing.h>
12
+ .PP
13
+ .BI "void io_uring_prep_fallocate(struct io_uring_sqe *" sqe ","
14
+ .BI " int " fd ","
15
+ .BI " int " mode ","
16
+ .BI " off_t " offset ","
17
+ .BI " off_t " len ");"
18
+ .fi
19
+ .SH DESCRIPTION
20
+ .PP
21
+ The
22
+ .BR io_uring_prep_fallocate (3)
23
+ function prepares a fallocate request. The submission queue entry
24
+ .I sqe
25
+ is setup to use the file descriptor pointed to by
26
+ .I fd
27
+ to start a fallocate operation described by
28
+ .I mode
29
+ at offset
30
+ .I offset
31
+ and
32
+ .I len
33
+ length in bytes.
34
+
35
+ This function prepares an async
36
+ .BR fallocate (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 fallocate (2)
@@ -0,0 +1,92 @@
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_files_update 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_files_update \- prepare a registered file update request
8
+ .SH SYNOPSIS
9
+ .nf
10
+ .B #include <liburing.h>
11
+ .PP
12
+ .BI "void io_uring_prep_files_update(struct io_uring_sqe *" sqe ","
13
+ .BI " int *" fds ","
14
+ .BI " unsigned " nr_fds ","
15
+ .BI " int " offset ");"
16
+ .fi
17
+ .SH DESCRIPTION
18
+ .PP
19
+ The
20
+ .BR io_uring_prep_files_update (3)
21
+ function prepares a request for updating a number of previously registered file
22
+ descriptors. The submission queue entry
23
+ .I sqe
24
+ is setup to use the file descriptor array pointed to by
25
+ .I fds
26
+ and of
27
+ .I nr_fds
28
+ in length to update that amount of previously registered files starting at
29
+ offset
30
+ .IR offset .
31
+
32
+ Once a previously registered file is updated with a new one, the existing
33
+ entry is updated and then removed from the table. This operation is equivalent to
34
+ first unregistering that entry and then inserting a new one, just bundled into
35
+ one combined operation.
36
+
37
+ If
38
+ .I offset
39
+ is specified as IORING_FILE_INDEX_ALLOC, io_uring will allocate free direct
40
+ descriptors instead of having the application to pass, and store allocated
41
+ direct descriptors into
42
+ .I fds
43
+ array,
44
+ .I cqe->res
45
+ will return the number of direct descriptors allocated.
46
+
47
+ .SH RETURN VALUE
48
+ None
49
+ .SH ERRORS
50
+ These are the errors that are reported in the CQE
51
+ .I res
52
+ field. On success,
53
+ .I res
54
+ will contain the number of successfully updated file descriptors. On error,
55
+ the following errors can occur.
56
+ .TP
57
+ .B -ENOMEM
58
+ The kernel was unable to allocate memory for the request.
59
+ .TP
60
+ .B -EINVAL
61
+ One of the fields set in the SQE was invalid.
62
+ .TP
63
+ .B -EFAULT
64
+ The kernel was unable to copy in the memory pointed to by
65
+ .IR fds .
66
+ .TP
67
+ .B -EBADF
68
+ On of the descriptors located in
69
+ .I fds
70
+ didn't refer to a valid file descriptor, or one of the file descriptors in
71
+ the array referred to an io_uring instance.
72
+ .TP
73
+ .B -EOVERFLOW
74
+ The product of
75
+ .I offset
76
+ and
77
+ .I nr_fds
78
+ exceed the valid amount or overflowed.
79
+ .SH NOTES
80
+ As with any request that passes in data in a struct, that data must remain
81
+ valid until the request has been successfully submitted. It need not remain
82
+ valid until completion. Once a request has been submitted, the in-kernel
83
+ state is stable. Very early kernels (5.4 and earlier) required state to be
84
+ stable until the completion occurred. Applications can test for this
85
+ behavior by inspecting the
86
+ .B IORING_FEAT_SUBMIT_STABLE
87
+ flag passed back from
88
+ .BR io_uring_queue_init_params (3).
89
+ .SH SEE ALSO
90
+ .BR io_uring_get_sqe (3),
91
+ .BR io_uring_submit (3),
92
+ .BR io_uring_register (2)
@@ -0,0 +1,70 @@
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_fsync 3 "March 12, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_fsync \- prepare an fsync request
8
+ .SH SYNOPSIS
9
+ .nf
10
+ .B #include <liburing.h>
11
+ .PP
12
+ .BI "void io_uring_prep_fsync(struct io_uring_sqe *" sqe ","
13
+ .BI " int " fd ","
14
+ .BI " unsigned " flags ");"
15
+ .fi
16
+ .SH DESCRIPTION
17
+ .PP
18
+ The
19
+ .BR io_uring_prep_fsync (3)
20
+ function prepares an fsync request. The submission queue entry
21
+ .I sqe
22
+ is setup to use the file descriptor
23
+ .I fd
24
+ that should get synced, with the modifier flags indicated by the
25
+ .I flags
26
+ argument.
27
+
28
+ This function prepares an fsync request. It can act either like an
29
+ .BR fsync (2)
30
+ operation, which is the default behavior. If
31
+ .B IORING_FSYNC_DATASYNC
32
+ is set in the
33
+ .I flags
34
+ argument, then it behaves like
35
+ .BR fdatasync (2).
36
+ If no range is specified, the
37
+ .I fd
38
+ will be synced from 0 to end-of-file.
39
+
40
+ It's possible to specify a range to sync, if one is desired. If the
41
+ .I off
42
+ field of the SQE is set to non-zero, then that indicates the offset to
43
+ start syncing at. If
44
+ .I len
45
+ is set in the SQE, then that indicates the size in bytes to sync from the
46
+ offset. Note that these fields are not accepted by this helper, so they have
47
+ to be set manually in the SQE after calling this prep helper.
48
+
49
+ .SH RETURN VALUE
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 SEE ALSO
67
+ .BR io_uring_get_sqe (3),
68
+ .BR io_uring_submit (3),
69
+ .BR fsync (2),
70
+ .BR fdatasync (2)
@@ -0,0 +1 @@
1
+ io_uring_prep_linkat.3
@@ -0,0 +1,91 @@
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_linkat 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_linkat \- prepare a linkat 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_linkat(struct io_uring_sqe *" sqe ","
15
+ .BI " int " olddirfd ","
16
+ .BI " const char *" oldpath ","
17
+ .BI " int " newdirfd ","
18
+ .BI " const char *" newpath ","
19
+ .BI " int " flags ");"
20
+ .PP
21
+ .BI "void io_uring_prep_link(struct io_uring_sqe *" sqe ","
22
+ .BI " const char *" oldpath ","
23
+ .BI " const char *" newpath ","
24
+ .BI " int " flags ");"
25
+ .fi
26
+ .SH DESCRIPTION
27
+ .PP
28
+ The
29
+ .BR io_uring_prep_linkat (3)
30
+ function prepares a linkat request. The submission queue entry
31
+ .I sqe
32
+ is setup to use the old directory file descriptor pointed to by
33
+ .I olddirfd
34
+ and old path pointed to by
35
+ .I oldpath
36
+ with the new directory file descriptor pointed to by
37
+ .I newdirfd
38
+ and the new path pointed to by
39
+ .I newpath
40
+ and using the specified flags in
41
+ .IR flags .
42
+
43
+ The
44
+ .BR io_uring_prep_link (3)
45
+ function prepares a link request. The submission queue entry
46
+ .I sqe
47
+ is setup to use the old path pointed to by
48
+ .I oldpath
49
+ and the new path pointed to by
50
+ .IR newpath ,
51
+ both relative to the current working directory and using the specified flags in
52
+ .IR flags .
53
+
54
+ These functions prepare an async
55
+ .BR linkat (2)
56
+ or
57
+ .BR link (2)
58
+ request. See those man pages for details.
59
+
60
+ .SH RETURN VALUE
61
+ None
62
+ .SH ERRORS
63
+ The CQE
64
+ .I res
65
+ field will contain the result of the operation. See the related man page for
66
+ details on possible values. Note that where synchronous system calls will return
67
+ .B -1
68
+ on failure and set
69
+ .I errno
70
+ to the actual error value, io_uring never uses
71
+ .IR errno .
72
+ Instead it returns the negated
73
+ .I errno
74
+ directly in the CQE
75
+ .I res
76
+ field.
77
+ .SH NOTES
78
+ As with any request that passes in data in a struct, that data must remain
79
+ valid until the request has been successfully submitted. It need not remain
80
+ valid until completion. Once a request has been submitted, the in-kernel
81
+ state is stable. Very early kernels (5.4 and earlier) required state to be
82
+ stable until the completion occurred. Applications can test for this
83
+ behavior by inspecting the
84
+ .B IORING_FEAT_SUBMIT_STABLE
85
+ flag passed back from
86
+ .BR io_uring_queue_init_params (3).
87
+ .SH SEE ALSO
88
+ .BR io_uring_get_sqe (3),
89
+ .BR io_uring_submit (3),
90
+ .BR linkat (2),
91
+ .BR link (2)
@@ -0,0 +1,56 @@
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_madvise 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_madvise \- prepare a madvise request
8
+ .SH SYNOPSIS
9
+ .nf
10
+ .B #include <sys/mman.h>
11
+ .B #include <liburing.h>
12
+ .PP
13
+ .BI "void io_uring_prep_madvise(struct io_uring_sqe *" sqe ","
14
+ .BI " void *" addr ","
15
+ .BI " off_t " len ","
16
+ .BI " int " advice ");"
17
+ .fi
18
+ .SH DESCRIPTION
19
+ .PP
20
+ The
21
+ .BR io_uring_prep_madvise (3)
22
+ function prepares an madvise request. The submission queue entry
23
+ .I sqe
24
+ is setup to start an madvise operation at the virtual address of
25
+ .I addr
26
+ and of
27
+ .I len
28
+ length in bytes, giving it the advise located in
29
+ .IR advice .
30
+
31
+ This function prepares an async
32
+ .BR madvise (2)
33
+ request. See that man page for details.
34
+
35
+ .SH RETURN VALUE
36
+ None
37
+ .SH ERRORS
38
+ The CQE
39
+ .I res
40
+ field will contain the result of the operation. See the related man page for
41
+ details on possible values. Note that where synchronous system calls will return
42
+ .B -1
43
+ on failure and set
44
+ .I errno
45
+ to the actual error value, io_uring never uses
46
+ .IR errno .
47
+ Instead it returns the negated
48
+ .I errno
49
+ directly in the CQE
50
+ .I res
51
+ field.
52
+ .SH SEE ALSO
53
+ .BR io_uring_get_sqe (3),
54
+ .BR io_uring_submit (3),
55
+ .BR io_uring_register (2),
56
+ .BR madvise (2)
@@ -0,0 +1 @@
1
+ io_uring_prep_mkdirat.3
@@ -0,0 +1,83 @@
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_mkdirat 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_mkdirat \- prepare an mkdirat request
8
+ .SH SYNOPSIS
9
+ .nf
10
+ .B #include <fcntl.h>
11
+ .B #include <sys/stat.h>
12
+ .B #include <liburing.h>
13
+ .PP
14
+ .BI "void io_uring_prep_mkdirat(struct io_uring_sqe *" sqe ","
15
+ .BI " int " dirfd ","
16
+ .BI " const char *" path ","
17
+ .BI " mode_t " mode ");"
18
+ .PP
19
+ .BI "void io_uring_prep_mkdir(struct io_uring_sqe *" sqe ","
20
+ .BI " const char *" path ","
21
+ .BI " mode_t " mode ");"
22
+ .fi
23
+ .SH DESCRIPTION
24
+ .PP
25
+ The
26
+ .BR io_uring_prep_mkdirat (3)
27
+ function prepares a mkdirat 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 mkdirat operation on the path identified by
32
+ .I path
33
+ with the mode given in
34
+ .IR mode .
35
+
36
+ The
37
+ .BR io_uring_prep_mkdir (3)
38
+ function prepares a mkdir request. The submission queue entry
39
+ .I sqe
40
+ is setup to use the current working directory to start a mkdir
41
+ operation on the path identified by
42
+ .I path
43
+ with the mode given in
44
+ .IR mode .
45
+
46
+ These functions prepare an async
47
+ .BR mkdir (2)
48
+ or
49
+ .BR mkdirat (2)
50
+ request. See those man pages 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 NOTES
70
+ As with any request that passes in data in a struct, that data must remain
71
+ valid until the request has been successfully submitted. It need not remain
72
+ valid until completion. Once a request has been submitted, the in-kernel
73
+ state is stable. Very early kernels (5.4 and earlier) required state to be
74
+ stable until the completion occurred. Applications can test for this
75
+ behavior by inspecting the
76
+ .B IORING_FEAT_SUBMIT_STABLE
77
+ flag passed back from
78
+ .BR io_uring_queue_init_params (3).
79
+ .SH SEE ALSO
80
+ .BR io_uring_get_sqe (3),
81
+ .BR io_uring_submit (3),
82
+ .BR mkdirat (2),
83
+ .BR mkdir (2)
@@ -4,38 +4,38 @@
4
4
  .\"
5
5
  .TH io_uring_prep_msg_ring 3 "March 10, 2022" "liburing-2.2" "liburing Manual"
6
6
  .SH NAME
7
- io_uring_prep_msg_ring - send a message to another ring
8
-
7
+ io_uring_prep_msg_ring \- send a message to another ring
9
8
  .SH SYNOPSIS
10
9
  .nf
11
- .BR "#include <liburing.h>"
10
+ .B #include <liburing.h>
12
11
  .PP
13
- .BI "void io_uring_msg_ring(struct io_uring_sqe *sqe,"
14
- .BI " int fd,"
15
- .BI " unsigned int len,"
16
- .BI " __u64 data,"
17
- .BI " unsigned int flags)"
18
-
12
+ .BI "void io_uring_prep_msg_ring(struct io_uring_sqe *" sqe ","
13
+ .BI " int " fd ","
14
+ .BI " unsigned int " len ","
15
+ .BI " __u64 " data ","
16
+ .BI " unsigned int " flags ");"
17
+ .fi
19
18
  .SH DESCRIPTION
20
19
  .PP
21
- io_uring_prep_msg_ring() prepares a to send a CQE to an io_uring file
22
- descriptor. The submission queue entry
20
+ .BR io_uring_prep_msg_ring (3)
21
+ prepares a to send a CQE to an io_uring file descriptor. The submission queue
22
+ entry
23
23
  .I sqe
24
24
  is setup to use the file descriptor
25
- .I fd
26
- , which must identify a io_uring context, to post a CQE on that ring where
27
- the target CQE
28
- .BR res
25
+ .IR fd ,
26
+ which must identify a io_uring context, to post a CQE on that ring where the
27
+ target CQE
28
+ .B res
29
29
  field will contain the content of
30
30
  .I len
31
31
  and the
32
- .BR user_data
32
+ .B user_data
33
33
  of
34
34
  .I data
35
35
  with the request modifier flags set by
36
- .I flags.
36
+ .IR flags .
37
37
  Currently there are no valid flag modifiers, this field must contain
38
- .B 0.
38
+ .BR 0 .
39
39
 
40
40
  The targeted ring may be any ring that the user has access to, even the ring
41
41
  itself. This request can be used for simple message passing to another ring,
@@ -47,12 +47,26 @@ fields. The use case may be anything from simply waking up someone waiting
47
47
  on the targeted ring, or it can be used to pass messages between the two
48
48
  rings.
49
49
 
50
- The resulting CQE posted on the target ring will have
51
- .B IORING_CQE_F_MSG
52
- set in its
53
- .I flags
54
- member, indicating to the target ring that this CQE is posted without having
55
- a relationship to an SQE issued on this ring.
56
-
57
50
  .SH RETURN VALUE
58
51
  None
52
+
53
+ .SH ERRORS
54
+ These are the errors that are reported in the CQE
55
+ .I res
56
+ field.
57
+ .TP
58
+ .B -ENOMEM
59
+ The kernel was unable to allocate memory for the request.
60
+ .TP
61
+ .B -EINVAL
62
+ One of the fields set in the SQE was invalid.
63
+ .TP
64
+ .B -EBADFD
65
+ The descriptor passed in
66
+ .I fd
67
+ does not refer to an io_uring file descriptor.
68
+ .TP
69
+ .B -EOVERFLOW
70
+ The kernel was unable to fill a CQE on the target ring. This can happen if
71
+ the target CQ ring is in an overflow state and the kernel wasn't able to
72
+ allocate memory for a new CQE entry.
@@ -0,0 +1 @@
1
+ io_uring_prep_accept.3
@@ -0,0 +1 @@
1
+ io_uring_prep_accept.3
@@ -0,0 +1,28 @@
1
+ .\" Copyright (C) 2022 Samuel Williams
2
+ .\"
3
+ .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
+ .\"
5
+ .TH io_uring_prep_nop 3 "October 20, 2022" "liburing-2.2" "liburing Manual"
6
+ .SH NAME
7
+ io_uring_prep_nop \- prepare a nop request
8
+ .SH SYNOPSIS
9
+ .nf
10
+ .B #include <liburing.h>
11
+ .PP
12
+ .BI "void io_uring_prep_nop(struct io_uring_sqe *" sqe ");"
13
+ .fi
14
+ .SH DESCRIPTION
15
+ .PP
16
+ The
17
+ .BR io_uring_prep_nop (3)
18
+ function prepares nop (no operation) request. The submission queue entry
19
+ .I sqe
20
+ does not require any additional setup.
21
+
22
+ .SH RETURN VALUE
23
+ None
24
+ .SH ERRORS
25
+ None
26
+ .SH SEE ALSO
27
+ .BR io_uring_get_sqe (3),
28
+ .BR io_uring_submit (3),