polyphony 0.98 → 0.99.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -1
- data/.rubocop.yml +3 -3
- data/.yardopts +30 -0
- data/CHANGELOG.md +11 -0
- data/LICENSE +1 -1
- data/README.md +63 -29
- data/Rakefile +1 -5
- data/TODO.md +0 -4
- data/docs/{main-concepts/concurrency.md → concurrency.md} +2 -9
- data/docs/{main-concepts/design-principles.md → design-principles.md} +3 -9
- data/docs/{main-concepts/exception-handling.md → exception-handling.md} +2 -9
- data/docs/{main-concepts/extending.md → extending.md} +2 -9
- data/docs/faq.md +3 -16
- data/docs/{main-concepts/fiber-scheduling.md → fiber-scheduling.md} +1 -9
- data/docs/link_rewriter.rb +16 -0
- data/docs/{getting-started/overview.md → overview.md} +1 -30
- data/docs/{getting-started/tutorial.md → tutorial.md} +3 -28
- data/docs/{_posts/2020-07-26-polyphony-0.44.md → whats-new.md} +3 -1
- data/examples/adapters/redis_client.rb +3 -2
- data/examples/io/echo_server.rb +1 -1
- data/examples/io/echo_server_plain_ruby.rb +26 -0
- data/examples/io/https_server_sni_2.rb +14 -8
- data/ext/polyphony/backend_io_uring.c +154 -9
- data/ext/polyphony/backend_io_uring_context.c +21 -12
- data/ext/polyphony/backend_io_uring_context.h +12 -7
- data/ext/polyphony/backend_libev.c +1 -1
- data/ext/polyphony/extconf.rb +25 -8
- data/ext/polyphony/fiber.c +79 -2
- data/ext/polyphony/io_extensions.c +53 -0
- data/ext/polyphony/libev.h +0 -2
- data/ext/polyphony/pipe.c +42 -2
- data/ext/polyphony/polyphony.c +345 -31
- data/ext/polyphony/polyphony.h +9 -2
- data/ext/polyphony/queue.c +181 -0
- data/ext/polyphony/ring_buffer.c +0 -1
- data/ext/polyphony/runqueue.c +8 -1
- data/ext/polyphony/runqueue_ring_buffer.c +13 -0
- data/ext/polyphony/runqueue_ring_buffer.h +2 -1
- data/ext/polyphony/socket_extensions.c +6 -0
- data/ext/polyphony/thread.c +34 -2
- data/lib/polyphony/adapters/process.rb +11 -1
- data/lib/polyphony/adapters/sequel.rb +1 -1
- data/lib/polyphony/core/channel.rb +2 -0
- data/lib/polyphony/core/debug.rb +1 -1
- data/lib/polyphony/core/global_api.rb +25 -24
- data/lib/polyphony/core/resource_pool.rb +7 -6
- data/lib/polyphony/core/sync.rb +55 -2
- data/lib/polyphony/core/thread_pool.rb +3 -3
- data/lib/polyphony/core/timer.rb +8 -8
- data/lib/polyphony/extensions/exception.rb +2 -0
- data/lib/polyphony/extensions/fiber.rb +15 -13
- data/lib/polyphony/extensions/io.rb +161 -16
- data/lib/polyphony/extensions/kernel.rb +20 -2
- data/lib/polyphony/extensions/openssl.rb +101 -12
- data/lib/polyphony/extensions/pipe.rb +103 -7
- data/lib/polyphony/extensions/process.rb +13 -1
- data/lib/polyphony/extensions/socket.rb +93 -27
- data/lib/polyphony/extensions/thread.rb +9 -1
- data/lib/polyphony/extensions/timeout.rb +1 -1
- data/lib/polyphony/version.rb +2 -1
- data/lib/polyphony.rb +27 -7
- data/polyphony.gemspec +1 -8
- data/test/stress.rb +1 -1
- data/test/test_global_api.rb +45 -7
- data/test/test_io.rb +6 -7
- data/test/test_socket.rb +157 -0
- data/test/test_sync.rb +42 -1
- data/test/test_timer.rb +5 -5
- data/vendor/liburing/.github/workflows/build.yml +7 -16
- data/vendor/liburing/.gitignore +5 -0
- data/vendor/liburing/CHANGELOG +23 -1
- data/vendor/liburing/Makefile +4 -3
- data/vendor/liburing/Makefile.common +1 -0
- data/vendor/liburing/README +48 -0
- data/vendor/liburing/configure +76 -6
- data/vendor/liburing/debian/changelog +11 -0
- data/vendor/liburing/debian/control +7 -16
- data/vendor/liburing/debian/liburing-dev.manpages +3 -6
- data/vendor/liburing/debian/liburing2.install +1 -0
- data/vendor/liburing/debian/liburing2.symbols +56 -0
- data/vendor/liburing/debian/rules +15 -68
- data/vendor/liburing/examples/Makefile +4 -0
- data/vendor/liburing/examples/io_uring-close-test.c +123 -0
- data/vendor/liburing/examples/io_uring-udp.c +1 -1
- data/vendor/liburing/examples/send-zerocopy.c +315 -56
- data/vendor/liburing/examples/ucontext-cp.c +2 -17
- data/vendor/liburing/liburing-ffi.pc.in +12 -0
- data/vendor/liburing/liburing.pc.in +1 -1
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/make-debs.sh +3 -3
- data/vendor/liburing/man/IO_URING_CHECK_VERSION.3 +1 -0
- data/vendor/liburing/man/IO_URING_VERSION_MAJOR.3 +1 -0
- data/vendor/liburing/man/IO_URING_VERSION_MINOR.3 +1 -0
- data/vendor/liburing/man/io_uring_buf_ring_add.3 +6 -6
- data/vendor/liburing/man/io_uring_check_version.3 +72 -0
- data/vendor/liburing/man/io_uring_close_ring_fd.3 +43 -0
- data/vendor/liburing/man/io_uring_major_version.3 +1 -0
- data/vendor/liburing/man/io_uring_minor_version.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_accept.3 +1 -1
- data/vendor/liburing/man/io_uring_prep_fgetxattr.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_fsetxattr.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_getxattr.3 +61 -0
- data/vendor/liburing/man/io_uring_prep_link_timeout.3 +94 -0
- data/vendor/liburing/man/io_uring_prep_msg_ring.3 +22 -2
- data/vendor/liburing/man/io_uring_prep_msg_ring_cqe_flags.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_poll_add.3 +1 -1
- data/vendor/liburing/man/io_uring_prep_provide_buffers.3 +18 -9
- data/vendor/liburing/man/io_uring_prep_readv.3 +3 -3
- data/vendor/liburing/man/io_uring_prep_readv2.3 +3 -3
- data/vendor/liburing/man/io_uring_prep_recv.3 +5 -5
- data/vendor/liburing/man/io_uring_prep_recvmsg.3 +4 -4
- data/vendor/liburing/man/io_uring_prep_send.3 +9 -0
- data/vendor/liburing/man/io_uring_prep_send_set_addr.3 +38 -0
- data/vendor/liburing/man/io_uring_prep_send_zc.3 +39 -7
- data/vendor/liburing/man/io_uring_prep_send_zc_fixed.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_sendmsg.3 +20 -0
- data/vendor/liburing/man/io_uring_prep_sendmsg_zc.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_setxattr.3 +64 -0
- data/vendor/liburing/man/io_uring_prep_splice.3 +40 -0
- data/vendor/liburing/man/io_uring_prep_writev.3 +2 -2
- data/vendor/liburing/man/io_uring_prep_writev2.3 +2 -2
- data/vendor/liburing/man/io_uring_recvmsg_out.3 +13 -9
- data/vendor/liburing/man/io_uring_register.2 +15 -9
- data/vendor/liburing/man/io_uring_register_buf_ring.3 +4 -4
- data/vendor/liburing/man/io_uring_register_buffers.3 +49 -6
- data/vendor/liburing/man/io_uring_register_buffers_sparse.3 +1 -0
- data/vendor/liburing/man/io_uring_register_buffers_tags.3 +1 -0
- data/vendor/liburing/man/io_uring_register_buffers_update_tag.3 +1 -0
- data/vendor/liburing/man/io_uring_register_files.3 +60 -5
- data/vendor/liburing/man/io_uring_register_files_tags.3 +1 -0
- data/vendor/liburing/man/io_uring_register_files_update.3 +1 -0
- data/vendor/liburing/man/io_uring_register_files_update_tag.3 +1 -0
- data/vendor/liburing/man/io_uring_setup.2 +31 -2
- data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +1 -1
- data/vendor/liburing/src/Makefile +25 -3
- data/vendor/liburing/src/ffi.c +15 -0
- data/vendor/liburing/src/include/liburing/io_uring.h +30 -7
- data/vendor/liburing/src/include/liburing.h +190 -148
- data/vendor/liburing/src/int_flags.h +1 -0
- data/vendor/liburing/src/lib.h +5 -16
- data/vendor/liburing/src/liburing-ffi.map +172 -0
- data/vendor/liburing/src/liburing.map +11 -0
- data/vendor/liburing/src/nolibc.c +9 -2
- data/vendor/liburing/src/queue.c +2 -2
- data/vendor/liburing/src/register.c +66 -96
- data/vendor/liburing/src/setup.c +5 -4
- data/vendor/liburing/src/version.c +21 -0
- data/vendor/liburing/test/232c93d07b74.c +3 -3
- data/vendor/liburing/test/35fa71a030ca.c +3 -3
- data/vendor/liburing/test/500f9fbadef8.c +2 -0
- data/vendor/liburing/test/917257daa0fe.c +1 -1
- data/vendor/liburing/test/Makefile +27 -7
- data/vendor/liburing/test/a0908ae19763.c +2 -2
- data/vendor/liburing/test/a4c0b3decb33.c +2 -2
- data/vendor/liburing/test/accept-link.c +4 -4
- data/vendor/liburing/test/accept-reuse.c +5 -7
- data/vendor/liburing/test/accept.c +34 -31
- data/vendor/liburing/test/b19062a56726.c +1 -1
- data/vendor/liburing/test/buf-ring.c +58 -4
- data/vendor/liburing/test/ce593a6c480a.c +2 -2
- data/vendor/liburing/test/close-opath.c +2 -1
- data/vendor/liburing/test/connect.c +8 -0
- data/vendor/liburing/test/cq-overflow.c +14 -8
- data/vendor/liburing/test/d4ae271dfaae.c +1 -1
- data/vendor/liburing/test/defer-taskrun.c +64 -9
- data/vendor/liburing/test/defer.c +1 -1
- data/vendor/liburing/test/double-poll-crash.c +3 -3
- data/vendor/liburing/test/eeed8b54e0df.c +8 -3
- data/vendor/liburing/test/eploop.c +74 -0
- data/vendor/liburing/test/eventfd-ring.c +1 -1
- data/vendor/liburing/test/eventfd.c +1 -1
- data/vendor/liburing/test/evloop.c +73 -0
- data/vendor/liburing/test/exit-no-cleanup.c +1 -1
- data/vendor/liburing/test/fadvise.c +1 -1
- data/vendor/liburing/test/fc2a85cb02ef.c +3 -3
- data/vendor/liburing/test/fd-pass.c +35 -16
- data/vendor/liburing/test/file-register.c +61 -0
- data/vendor/liburing/test/file-verify.c +2 -2
- data/vendor/liburing/test/files-exit-hang-timeout.c +2 -2
- data/vendor/liburing/test/fixed-link.c +1 -1
- data/vendor/liburing/test/fsnotify.c +118 -0
- data/vendor/liburing/test/hardlink.c +1 -1
- data/vendor/liburing/test/helpers.c +54 -2
- data/vendor/liburing/test/helpers.h +4 -0
- data/vendor/liburing/test/io-cancel.c +3 -1
- data/vendor/liburing/test/io_uring_passthrough.c +39 -8
- data/vendor/liburing/test/io_uring_setup.c +3 -80
- data/vendor/liburing/test/iopoll-overflow.c +118 -0
- data/vendor/liburing/test/iopoll.c +90 -4
- data/vendor/liburing/test/lfs-openat-write.c +7 -9
- data/vendor/liburing/test/lfs-openat.c +6 -8
- data/vendor/liburing/test/link_drain.c +31 -5
- data/vendor/liburing/test/madvise.c +1 -1
- data/vendor/liburing/test/msg-ring-flags.c +192 -0
- data/vendor/liburing/test/msg-ring-overflow.c +159 -0
- data/vendor/liburing/test/msg-ring.c +173 -13
- data/vendor/liburing/test/multicqes_drain.c +22 -19
- data/vendor/liburing/test/nvme.h +4 -3
- data/vendor/liburing/test/pipe-bug.c +95 -0
- data/vendor/liburing/test/poll-link.c +3 -3
- data/vendor/liburing/test/poll-many.c +41 -19
- data/vendor/liburing/test/poll-mshot-overflow.c +105 -2
- data/vendor/liburing/test/poll-race-mshot.c +292 -0
- data/vendor/liburing/test/poll-race.c +105 -0
- data/vendor/liburing/test/poll.c +244 -26
- data/vendor/liburing/test/pollfree.c +5 -5
- data/vendor/liburing/test/read-before-exit.c +20 -3
- data/vendor/liburing/test/read-write.c +2 -0
- data/vendor/liburing/test/recv-multishot.c +96 -3
- data/vendor/liburing/test/reg-reg-ring.c +90 -0
- data/vendor/liburing/test/rename.c +1 -1
- data/vendor/liburing/test/ring-leak.c +0 -1
- data/vendor/liburing/test/ring-leak2.c +1 -1
- data/vendor/liburing/test/ringbuf-read.c +10 -6
- data/vendor/liburing/test/send-zerocopy.c +273 -103
- data/vendor/liburing/test/send_recv.c +7 -4
- data/vendor/liburing/test/sendmsg_fs_cve.c +2 -2
- data/vendor/liburing/test/single-issuer.c +7 -9
- data/vendor/liburing/test/skip-cqe.c +3 -4
- data/vendor/liburing/test/socket.c +0 -1
- data/vendor/liburing/test/sq-poll-dup.c +10 -3
- data/vendor/liburing/test/sq-poll-kthread.c +1 -1
- data/vendor/liburing/test/sq-poll-share.c +3 -2
- data/vendor/liburing/test/sqpoll-cancel-hang.c +17 -6
- data/vendor/liburing/test/sqpoll-disable-exit.c +4 -4
- data/vendor/liburing/test/symlink.c +2 -1
- data/vendor/liburing/test/test.h +2 -1
- data/vendor/liburing/test/timeout-new.c +11 -7
- data/vendor/liburing/test/timeout.c +1 -2
- data/vendor/liburing/test/unlink.c +1 -1
- data/vendor/liburing/test/version.c +25 -0
- data/vendor/liburing/test/wakeup-hang.c +1 -1
- data/vendor/liburing/test/xattr.c +8 -4
- metadata +57 -44
- data/docs/_config.yml +0 -64
- data/docs/_includes/head.html +0 -40
- data/docs/_includes/title.html +0 -1
- data/docs/_sass/custom/custom.scss +0 -10
- data/docs/_sass/overrides.scss +0 -0
- data/docs/api-reference/exception.md +0 -31
- data/docs/api-reference/fiber.md +0 -425
- data/docs/api-reference/index.md +0 -9
- data/docs/api-reference/io.md +0 -36
- data/docs/api-reference/object.md +0 -99
- data/docs/api-reference/polyphony-baseexception.md +0 -33
- data/docs/api-reference/polyphony-cancel.md +0 -26
- data/docs/api-reference/polyphony-moveon.md +0 -24
- data/docs/api-reference/polyphony-net.md +0 -20
- data/docs/api-reference/polyphony-process.md +0 -28
- data/docs/api-reference/polyphony-resourcepool.md +0 -59
- data/docs/api-reference/polyphony-restart.md +0 -18
- data/docs/api-reference/polyphony-terminate.md +0 -18
- data/docs/api-reference/polyphony-threadpool.md +0 -67
- data/docs/api-reference/polyphony-throttler.md +0 -77
- data/docs/api-reference/polyphony.md +0 -36
- data/docs/api-reference/thread.md +0 -88
- data/docs/favicon.ico +0 -0
- data/docs/getting-started/index.md +0 -10
- data/docs/getting-started/installing.md +0 -34
- data/vendor/liburing/debian/compat +0 -1
- data/vendor/liburing/debian/liburing1-udeb.install +0 -1
- data/vendor/liburing/debian/liburing1.install +0 -1
- data/vendor/liburing/debian/liburing1.symbols +0 -32
- /data/{docs/assets/img → assets}/echo-fibers.svg +0 -0
- /data/{docs → assets}/polyphony-logo.png +0 -0
- /data/{docs/assets/img → assets}/sleeping-fiber.svg +0 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
liburing.so.2 liburing2 #MINVER# [47/1887]
|
2
|
+
LIBURING_2.0@LIBURING_2.0 0.7-1
|
3
|
+
LIBURING_2.1@LIBURING_2.1 0.7-1
|
4
|
+
LIBURING_2.2@LIBURING_2.2 0.7-1
|
5
|
+
LIBURING_2.3@LIBURING_2.3 0.7-1
|
6
|
+
__io_uring_get_cqe@LIBURING_2.0 0.7-1
|
7
|
+
__io_uring_sqring_wait@LIBURING_2.0 0.7-1
|
8
|
+
io_uring_enter2@LIBURING_2.3 0.7-1
|
9
|
+
io_uring_enter@LIBURING_2.3 0.7-1
|
10
|
+
io_uring_free_probe@LIBURING_2.0 0.7-1
|
11
|
+
io_uring_get_events@LIBURING_2.3 0.7-1
|
12
|
+
io_uring_get_probe@LIBURING_2.0 0.7-1
|
13
|
+
io_uring_get_probe_ring@LIBURING_2.0 0.7-1
|
14
|
+
io_uring_get_sqe@LIBURING_2.0 0.7-1
|
15
|
+
io_uring_mlock_size@LIBURING_2.1 0.7-1
|
16
|
+
io_uring_mlock_size_params@LIBURING_2.1 0.7-1
|
17
|
+
io_uring_peek_batch_cqe@LIBURING_2.0 0.7-1
|
18
|
+
io_uring_queue_exit@LIBURING_2.0 0.7-1
|
19
|
+
io_uring_queue_init@LIBURING_2.0 0.7-1
|
20
|
+
io_uring_queue_init_params@LIBURING_2.0 0.7-1
|
21
|
+
io_uring_queue_mmap@LIBURING_2.0 0.7-1
|
22
|
+
io_uring_register@LIBURING_2.3 0.7-1
|
23
|
+
io_uring_register_buf_ring@LIBURING_2.2 0.7-1
|
24
|
+
io_uring_register_buffers@LIBURING_2.0 0.7-1
|
25
|
+
io_uring_register_buffers_sparse@LIBURING_2.2 0.7-1
|
26
|
+
io_uring_register_buffers_tags@LIBURING_2.1 0.7-1
|
27
|
+
io_uring_register_buffers_update_tag@LIBURING_2.1 0.7-1
|
28
|
+
io_uring_register_eventfd@LIBURING_2.0 0.7-1
|
29
|
+
io_uring_register_eventfd_async@LIBURING_2.0 0.7-1
|
30
|
+
io_uring_register_file_alloc_range@LIBURING_2.3 0.7-1
|
31
|
+
io_uring_register_files@LIBURING_2.0 0.7-1
|
32
|
+
io_uring_register_files_sparse@LIBURING_2.2 0.7-1
|
33
|
+
io_uring_register_files_tags@LIBURING_2.1 0.7-1
|
34
|
+
io_uring_register_files_update@LIBURING_2.0 0.7-1
|
35
|
+
io_uring_register_files_update_tag@LIBURING_2.1 0.7-1
|
36
|
+
io_uring_register_iowq_aff@LIBURING_2.1 0.7-1
|
37
|
+
io_uring_register_iowq_max_workers@LIBURING_2.1 0.7-1
|
38
|
+
io_uring_register_personality@LIBURING_2.0 0.7-1
|
39
|
+
io_uring_register_probe@LIBURING_2.0 0.7-1
|
40
|
+
io_uring_register_ring_fd@LIBURING_2.2 0.7-1
|
41
|
+
io_uring_register_sync_cancel@LIBURING_2.3 0.7-1
|
42
|
+
io_uring_ring_dontfork@LIBURING_2.0 0.7-1
|
43
|
+
io_uring_setup@LIBURING_2.3 0.7-1
|
44
|
+
io_uring_submit@LIBURING_2.0 0.7-1
|
45
|
+
io_uring_submit_and_get_events@LIBURING_2.3 0.7-1
|
46
|
+
io_uring_submit_and_wait@LIBURING_2.0 0.7-1
|
47
|
+
io_uring_submit_and_wait_timeout@LIBURING_2.2 0.7-1
|
48
|
+
io_uring_unregister_buf_ring@LIBURING_2.2 0.7-1
|
49
|
+
io_uring_unregister_buffers@LIBURING_2.0 0.7-1
|
50
|
+
io_uring_unregister_eventfd@LIBURING_2.0 0.7-1
|
51
|
+
io_uring_unregister_files@LIBURING_2.0 0.7-1
|
52
|
+
io_uring_unregister_iowq_aff@LIBURING_2.1 0.7-1
|
53
|
+
io_uring_unregister_personality@LIBURING_2.0 0.7-1
|
54
|
+
io_uring_unregister_ring_fd@LIBURING_2.2 0.7-1
|
55
|
+
io_uring_wait_cqe_timeout@LIBURING_2.0 0.7-1
|
56
|
+
io_uring_wait_cqes@LIBURING_2.0 0.7-1
|
@@ -9,73 +9,20 @@ DEB_CFLAGS_MAINT_PREPEND = -Wall
|
|
9
9
|
include /usr/share/dpkg/default.mk
|
10
10
|
include /usr/share/dpkg/buildtools.mk
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
build: build-indep build-arch
|
27
|
-
|
28
|
-
clean:
|
29
|
-
dh_testdir
|
30
|
-
dh_testroot
|
31
|
-
|
32
|
-
$(MAKE) clean
|
33
|
-
|
34
|
-
dh_clean
|
35
|
-
|
36
|
-
check-arch: build-arch
|
37
|
-
dh_testdir
|
38
|
-
|
12
|
+
%:
|
13
|
+
dh $@
|
14
|
+
|
15
|
+
override_dh_auto_configure:
|
16
|
+
./configure \
|
17
|
+
--prefix=/usr \
|
18
|
+
--includedir=/usr/include \
|
19
|
+
--datadir=/usr/share \
|
20
|
+
--mandir=/usr/share/man \
|
21
|
+
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
|
22
|
+
--libdevdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
|
23
|
+
--cc=$(CC)
|
24
|
+
|
25
|
+
override_dh_auto_test:
|
39
26
|
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
|
40
|
-
$(MAKE)
|
41
|
-
partcheck
|
27
|
+
$(MAKE) runtests
|
42
28
|
endif
|
43
|
-
|
44
|
-
install-arch: check-arch
|
45
|
-
dh_testdir
|
46
|
-
dh_testroot
|
47
|
-
dh_clean
|
48
|
-
dh_installdirs
|
49
|
-
|
50
|
-
$(MAKE) install \
|
51
|
-
DESTDIR=$(CURDIR)/debian/tmp \
|
52
|
-
libdir=/lib/$(DEB_HOST_MULTIARCH) \
|
53
|
-
libdevdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
|
54
|
-
relativelibdir=/lib/$(DEB_HOST_MULTIARCH)/
|
55
|
-
|
56
|
-
binary: binary-indep binary-arch
|
57
|
-
|
58
|
-
binary-indep:
|
59
|
-
# Nothing to do.
|
60
|
-
|
61
|
-
binary-arch: install-arch
|
62
|
-
dh_testdir
|
63
|
-
dh_testroot
|
64
|
-
dh_install -a
|
65
|
-
dh_installdocs -a
|
66
|
-
dh_installexamples -a
|
67
|
-
dh_installman -a
|
68
|
-
dh_lintian -a
|
69
|
-
dh_link -a
|
70
|
-
dh_strip -a --ddeb-migration='$(libdbg) (<< 0.3)'
|
71
|
-
dh_compress -a
|
72
|
-
dh_fixperms -a
|
73
|
-
dh_makeshlibs -a --add-udeb '$(libudeb)'
|
74
|
-
dh_shlibdeps -a
|
75
|
-
dh_installdeb -a
|
76
|
-
dh_gencontrol -a
|
77
|
-
dh_md5sums -a
|
78
|
-
dh_builddeb -a
|
79
|
-
|
80
|
-
.PHONY: clean build-indep build-arch build
|
81
|
-
.PHONY: install-arch binary-indep binary-arch binary
|
@@ -0,0 +1,123 @@
|
|
1
|
+
/* SPDX-License-Identifier: MIT */
|
2
|
+
/*
|
3
|
+
* Simple app that demonstrates how to setup an io_uring interface, and use it
|
4
|
+
* via a registered ring fd, without leaving the original fd open.
|
5
|
+
*
|
6
|
+
* gcc -Wall -O2 -D_GNU_SOURCE -o io_uring-close-test io_uring-close-test.c -luring
|
7
|
+
*/
|
8
|
+
#include <stdio.h>
|
9
|
+
#include <fcntl.h>
|
10
|
+
#include <string.h>
|
11
|
+
#include <stdlib.h>
|
12
|
+
#include <sys/types.h>
|
13
|
+
#include <sys/stat.h>
|
14
|
+
#include <unistd.h>
|
15
|
+
#include "liburing.h"
|
16
|
+
|
17
|
+
#define QD 4
|
18
|
+
|
19
|
+
int main(int argc, char *argv[])
|
20
|
+
{
|
21
|
+
struct io_uring ring;
|
22
|
+
int i, fd, ret, pending, done;
|
23
|
+
struct io_uring_sqe *sqe;
|
24
|
+
struct io_uring_cqe *cqe;
|
25
|
+
struct iovec *iovecs;
|
26
|
+
struct stat sb;
|
27
|
+
ssize_t fsize;
|
28
|
+
off_t offset;
|
29
|
+
void *buf;
|
30
|
+
|
31
|
+
if (argc < 2) {
|
32
|
+
printf("%s: file\n", argv[0]);
|
33
|
+
return 1;
|
34
|
+
}
|
35
|
+
|
36
|
+
ret = io_uring_queue_init(QD, &ring, 0);
|
37
|
+
if (ret < 0) {
|
38
|
+
fprintf(stderr, "queue_init: %s\n", strerror(-ret));
|
39
|
+
return 1;
|
40
|
+
}
|
41
|
+
|
42
|
+
ret = io_uring_register_ring_fd(&ring);
|
43
|
+
if (ret < 0) {
|
44
|
+
fprintf(stderr, "register_ring_fd: %s\n", strerror(-ret));
|
45
|
+
return 1;
|
46
|
+
}
|
47
|
+
ret = io_uring_close_ring_fd(&ring);
|
48
|
+
if (ret < 0) {
|
49
|
+
fprintf(stderr, "close_ring_fd: %s\n", strerror(-ret));
|
50
|
+
return 1;
|
51
|
+
}
|
52
|
+
|
53
|
+
fd = open(argv[1], O_RDONLY);
|
54
|
+
if (fd < 0) {
|
55
|
+
perror("open");
|
56
|
+
return 1;
|
57
|
+
}
|
58
|
+
|
59
|
+
if (fstat(fd, &sb) < 0) {
|
60
|
+
perror("fstat");
|
61
|
+
return 1;
|
62
|
+
}
|
63
|
+
|
64
|
+
fsize = 0;
|
65
|
+
iovecs = calloc(QD, sizeof(struct iovec));
|
66
|
+
for (i = 0; i < QD; i++) {
|
67
|
+
if (posix_memalign(&buf, 4096, 4096))
|
68
|
+
return 1;
|
69
|
+
iovecs[i].iov_base = buf;
|
70
|
+
iovecs[i].iov_len = 4096;
|
71
|
+
fsize += 4096;
|
72
|
+
}
|
73
|
+
|
74
|
+
offset = 0;
|
75
|
+
i = 0;
|
76
|
+
do {
|
77
|
+
sqe = io_uring_get_sqe(&ring);
|
78
|
+
if (!sqe)
|
79
|
+
break;
|
80
|
+
io_uring_prep_readv(sqe, fd, &iovecs[i], 1, offset);
|
81
|
+
offset += iovecs[i].iov_len;
|
82
|
+
i++;
|
83
|
+
if (offset > sb.st_size)
|
84
|
+
break;
|
85
|
+
} while (1);
|
86
|
+
|
87
|
+
ret = io_uring_submit(&ring);
|
88
|
+
if (ret < 0) {
|
89
|
+
fprintf(stderr, "io_uring_submit: %s\n", strerror(-ret));
|
90
|
+
return 1;
|
91
|
+
} else if (ret != i) {
|
92
|
+
fprintf(stderr, "io_uring_submit submitted less %d\n", ret);
|
93
|
+
return 1;
|
94
|
+
}
|
95
|
+
|
96
|
+
done = 0;
|
97
|
+
pending = ret;
|
98
|
+
fsize = 0;
|
99
|
+
for (i = 0; i < pending; i++) {
|
100
|
+
ret = io_uring_wait_cqe(&ring, &cqe);
|
101
|
+
if (ret < 0) {
|
102
|
+
fprintf(stderr, "io_uring_wait_cqe: %s\n", strerror(-ret));
|
103
|
+
return 1;
|
104
|
+
}
|
105
|
+
|
106
|
+
done++;
|
107
|
+
ret = 0;
|
108
|
+
if (cqe->res != 4096 && cqe->res + fsize != sb.st_size) {
|
109
|
+
fprintf(stderr, "ret=%d, wanted 4096\n", cqe->res);
|
110
|
+
ret = 1;
|
111
|
+
}
|
112
|
+
fsize += cqe->res;
|
113
|
+
io_uring_cqe_seen(&ring, cqe);
|
114
|
+
if (ret)
|
115
|
+
break;
|
116
|
+
}
|
117
|
+
|
118
|
+
printf("Submitted=%d, completed=%d, bytes=%lu\n", pending, done,
|
119
|
+
(unsigned long) fsize);
|
120
|
+
close(fd);
|
121
|
+
io_uring_queue_exit(&ring);
|
122
|
+
return 0;
|
123
|
+
}
|
@@ -275,7 +275,7 @@ static int process_cqe_recv(struct ctx *ctx, struct io_uring_cqe *cqe,
|
|
275
275
|
const char *name;
|
276
276
|
struct sockaddr_in *addr = io_uring_recvmsg_name(o);
|
277
277
|
|
278
|
-
name = inet_ntop(ctx->af, addr, buff, sizeof(buff));
|
278
|
+
name = inet_ntop(ctx->af, &addr->sin_addr, buff, sizeof(buff));
|
279
279
|
if (!name)
|
280
280
|
name = "<INVALID>";
|
281
281
|
fprintf(stderr, "received %u bytes %d from %s:%d\n",
|