polyphony 0.94 → 0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/ext/polyphony/backend_common.c +3 -3
- data/ext/polyphony/backend_io_uring.c +18 -16
- data/ext/polyphony/event.c +1 -1
- data/ext/polyphony/extconf.rb +5 -3
- data/ext/polyphony/fiber.c +5 -13
- data/ext/polyphony/io_extensions.c +1 -1
- data/ext/polyphony/pipe.c +1 -1
- data/ext/polyphony/polyphony.c +1 -1
- data/ext/polyphony/polyphony_ext.c +1 -1
- data/ext/polyphony/queue.c +1 -1
- data/ext/polyphony/ring_buffer.c +1 -0
- data/ext/polyphony/socket_extensions.c +1 -1
- data/ext/polyphony/thread.c +1 -1
- data/lib/polyphony/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_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 +143 -22
- data/Gemfile.lock +0 -78
|
@@ -10,45 +10,8 @@
|
|
|
10
10
|
#include <sys/mman.h>
|
|
11
11
|
#include <sys/syscall.h>
|
|
12
12
|
#include <sys/resource.h>
|
|
13
|
-
|
|
14
13
|
#include <liburing.h>
|
|
15
14
|
|
|
16
|
-
#ifdef __alpha__
|
|
17
|
-
/*
|
|
18
|
-
* alpha and mips are exception, other architectures have
|
|
19
|
-
* common numbers for new system calls.
|
|
20
|
-
*/
|
|
21
|
-
# ifndef __NR_io_uring_setup
|
|
22
|
-
# define __NR_io_uring_setup 535
|
|
23
|
-
# endif
|
|
24
|
-
# ifndef __NR_io_uring_enter
|
|
25
|
-
# define __NR_io_uring_enter 536
|
|
26
|
-
# endif
|
|
27
|
-
# ifndef __NR_io_uring_register
|
|
28
|
-
# define __NR_io_uring_register 537
|
|
29
|
-
# endif
|
|
30
|
-
#elif defined __mips__
|
|
31
|
-
# ifndef __NR_io_uring_setup
|
|
32
|
-
# define __NR_io_uring_setup (__NR_Linux + 425)
|
|
33
|
-
# endif
|
|
34
|
-
# ifndef __NR_io_uring_enter
|
|
35
|
-
# define __NR_io_uring_enter (__NR_Linux + 426)
|
|
36
|
-
# endif
|
|
37
|
-
# ifndef __NR_io_uring_register
|
|
38
|
-
# define __NR_io_uring_register (__NR_Linux + 427)
|
|
39
|
-
# endif
|
|
40
|
-
#else /* !__alpha__ and !__mips__ */
|
|
41
|
-
# ifndef __NR_io_uring_setup
|
|
42
|
-
# define __NR_io_uring_setup 425
|
|
43
|
-
# endif
|
|
44
|
-
# ifndef __NR_io_uring_enter
|
|
45
|
-
# define __NR_io_uring_enter 426
|
|
46
|
-
# endif
|
|
47
|
-
# ifndef __NR_io_uring_register
|
|
48
|
-
# define __NR_io_uring_register 427
|
|
49
|
-
# endif
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
15
|
/*
|
|
53
16
|
* Don't put this below the #include "arch/$arch/syscall.h", that
|
|
54
17
|
* file may need it.
|
|
@@ -60,9 +23,9 @@ static inline void *ERR_PTR(intptr_t n)
|
|
|
60
23
|
return (void *) n;
|
|
61
24
|
}
|
|
62
25
|
|
|
63
|
-
static inline
|
|
26
|
+
static inline int PTR_ERR(const void *ptr)
|
|
64
27
|
{
|
|
65
|
-
return (intptr_t) ptr;
|
|
28
|
+
return (int) (intptr_t) ptr;
|
|
66
29
|
}
|
|
67
30
|
|
|
68
31
|
static inline bool IS_ERR(const void *ptr)
|
|
@@ -70,34 +33,19 @@ static inline bool IS_ERR(const void *ptr)
|
|
|
70
33
|
return uring_unlikely((uintptr_t) ptr >= (uintptr_t) -4095UL);
|
|
71
34
|
}
|
|
72
35
|
|
|
73
|
-
#define __INTERNAL__LIBURING_SYSCALL_H
|
|
74
36
|
#if defined(__x86_64__) || defined(__i386__)
|
|
75
|
-
|
|
37
|
+
#include "arch/x86/syscall.h"
|
|
76
38
|
#elif defined(__aarch64__)
|
|
77
|
-
|
|
39
|
+
#include "arch/aarch64/syscall.h"
|
|
78
40
|
#else
|
|
79
|
-
/*
|
|
80
|
-
* We don't have native syscall wrappers
|
|
81
|
-
* for this arch. Must use libc!
|
|
82
|
-
*/
|
|
83
|
-
#ifdef CONFIG_NOLIBC
|
|
84
|
-
#error "This arch doesn't support building liburing without libc"
|
|
85
|
-
#endif
|
|
86
|
-
/* libc syscall wrappers. */
|
|
87
|
-
#include "arch/generic/syscall.h"
|
|
88
|
-
#endif
|
|
89
|
-
#undef __INTERNAL__LIBURING_SYSCALL_H
|
|
90
|
-
|
|
91
41
|
/*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
42
|
+
* We don't have native syscall wrappers
|
|
43
|
+
* for this arch. Must use libc!
|
|
94
44
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
unsigned int nr_args);
|
|
102
|
-
|
|
45
|
+
#ifdef CONFIG_NOLIBC
|
|
46
|
+
#error "This arch doesn't support building liburing without libc"
|
|
47
|
+
#endif
|
|
48
|
+
/* libc syscall wrappers. */
|
|
49
|
+
#include "arch/generic/syscall.h"
|
|
50
|
+
#endif
|
|
103
51
|
#endif
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
#include <netinet/in.h>
|
|
22
22
|
#include <arpa/inet.h>
|
|
23
23
|
|
|
24
|
+
#include "helpers.h"
|
|
24
25
|
#include "liburing.h"
|
|
25
26
|
|
|
26
27
|
#define RECV_BUFF_SIZE 2
|
|
27
28
|
#define SEND_BUFF_SIZE 3
|
|
28
29
|
|
|
29
|
-
#define PORT 0x1235
|
|
30
|
-
|
|
31
30
|
struct params {
|
|
32
31
|
int tcp;
|
|
33
32
|
int non_blocking;
|
|
33
|
+
__be16 bind_port;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
@@ -76,10 +76,9 @@ static void *rcv(void *arg)
|
|
|
76
76
|
struct sockaddr_in addr;
|
|
77
77
|
|
|
78
78
|
addr.sin_family = AF_INET;
|
|
79
|
-
addr.sin_port = htons(PORT);
|
|
80
79
|
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
assert(t_bind_ephemeral_port(s0, &addr) == 0);
|
|
81
|
+
p->bind_port = addr.sin_port;
|
|
83
82
|
} else {
|
|
84
83
|
s0 = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
|
85
84
|
assert(s0 != -1);
|
|
@@ -191,7 +190,7 @@ static void *snd(void *arg)
|
|
|
191
190
|
struct sockaddr_in addr;
|
|
192
191
|
|
|
193
192
|
addr.sin_family = AF_INET;
|
|
194
|
-
addr.sin_port =
|
|
193
|
+
addr.sin_port = p->bind_port;
|
|
195
194
|
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
|
|
196
195
|
ret = connect(s0, (struct sockaddr*) &addr, sizeof(addr));
|
|
197
196
|
assert(ret != -1);
|
|
@@ -281,10 +280,10 @@ int main(int argc, char *argv[])
|
|
|
281
280
|
struct params p;
|
|
282
281
|
pthread_t t1, t2;
|
|
283
282
|
void *res1, *res2;
|
|
284
|
-
int i, exit_val =
|
|
283
|
+
int i, exit_val = T_EXIT_PASS;
|
|
285
284
|
|
|
286
285
|
if (argc > 1)
|
|
287
|
-
return
|
|
286
|
+
return T_EXIT_SKIP;
|
|
288
287
|
|
|
289
288
|
for (i = 0; i < 4; i++) {
|
|
290
289
|
p.tcp = i & 1;
|
|
@@ -298,7 +297,7 @@ int main(int argc, char *argv[])
|
|
|
298
297
|
pthread_join(t2, &res2);
|
|
299
298
|
if (res1 || res2) {
|
|
300
299
|
fprintf(stderr, "Failed tcp=%d, non_blocking=%d\n", p.tcp, p.non_blocking);
|
|
301
|
-
exit_val =
|
|
300
|
+
exit_val = T_EXIT_FAIL;
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
#include <linux/futex.h>
|
|
26
26
|
|
|
27
27
|
#include "liburing.h"
|
|
28
|
+
#include "helpers.h"
|
|
28
29
|
#include "../src/syscall.h"
|
|
29
30
|
|
|
30
31
|
#if !defined(SYS_futex) && defined(SYS_futex_time64)
|
|
@@ -238,8 +239,7 @@ static void execute_one(void);
|
|
|
238
239
|
|
|
239
240
|
static void loop(void)
|
|
240
241
|
{
|
|
241
|
-
|
|
242
|
-
for (iter = 0;; iter++) {
|
|
242
|
+
for (;;) {
|
|
243
243
|
int pid = fork();
|
|
244
244
|
if (pid < 0)
|
|
245
245
|
exit(1);
|
|
@@ -318,12 +318,12 @@ static void sig_int(int sig)
|
|
|
318
318
|
int main(int argc, char *argv[])
|
|
319
319
|
{
|
|
320
320
|
if (argc > 1)
|
|
321
|
-
return
|
|
321
|
+
return T_EXIT_SKIP;
|
|
322
322
|
signal(SIGINT, sig_int);
|
|
323
323
|
mmap((void *) 0x20000000, 0x1000000, 3, 0x32, -1, 0);
|
|
324
324
|
signal(SIGALRM, sig_int);
|
|
325
325
|
alarm(5);
|
|
326
326
|
|
|
327
327
|
loop();
|
|
328
|
-
return
|
|
328
|
+
return T_EXIT_PASS;
|
|
329
329
|
}
|
|
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
|
|
|
27
27
|
int ret, fd;
|
|
28
28
|
|
|
29
29
|
if (argc > 1)
|
|
30
|
-
return
|
|
30
|
+
return T_EXIT_SKIP;
|
|
31
31
|
|
|
32
32
|
t_posix_memalign(&iov.iov_base, 4096, 4096);
|
|
33
33
|
iov.iov_len = 4096;
|
|
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
|
|
|
35
35
|
ret = io_uring_queue_init(1, &ring, IORING_SETUP_IOPOLL);
|
|
36
36
|
if (ret) {
|
|
37
37
|
fprintf(stderr, "ring setup failed\n");
|
|
38
|
-
return
|
|
38
|
+
return T_EXIT_FAIL;
|
|
39
39
|
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
|
|
|
43
43
|
fd = mkostemp(buf, O_WRONLY | O_DIRECT | O_CREAT);
|
|
44
44
|
if (fd < 0) {
|
|
45
45
|
perror("mkostemp");
|
|
46
|
-
return
|
|
46
|
+
return T_EXIT_FAIL;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
offset = 0;
|
|
@@ -73,17 +73,17 @@ int main(int argc, char *argv[])
|
|
|
73
73
|
io_uring_cqe_seen(&ring, cqe);
|
|
74
74
|
offset += 4096;
|
|
75
75
|
} while (--blocks);
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
close(fd);
|
|
78
78
|
unlink(buf);
|
|
79
|
-
return
|
|
79
|
+
return T_EXIT_PASS;
|
|
80
80
|
err:
|
|
81
81
|
close(fd);
|
|
82
82
|
unlink(buf);
|
|
83
|
-
return
|
|
83
|
+
return T_EXIT_FAIL;
|
|
84
84
|
skipped:
|
|
85
85
|
fprintf(stderr, "Polling not supported in current dir, test skipped\n");
|
|
86
86
|
close(fd);
|
|
87
87
|
unlink(buf);
|
|
88
|
-
return
|
|
88
|
+
return T_EXIT_SKIP;
|
|
89
89
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#include <time.h>
|
|
4
4
|
#include <sys/time.h>
|
|
5
5
|
#include "liburing.h"
|
|
6
|
+
#include "helpers.h"
|
|
6
7
|
|
|
7
8
|
static unsigned long long mtime_since(const struct timeval *s,
|
|
8
9
|
const struct timeval *e)
|
|
@@ -40,12 +41,12 @@ int main(int argc, char *argv[])
|
|
|
40
41
|
int ret;
|
|
41
42
|
|
|
42
43
|
if (argc > 1)
|
|
43
|
-
return
|
|
44
|
+
return T_EXIT_SKIP;
|
|
44
45
|
|
|
45
46
|
ret = io_uring_queue_init(32, &ring, 0);
|
|
46
47
|
if (ret) {
|
|
47
48
|
fprintf(stderr, "io_uring_queue_init=%d\n", ret);
|
|
48
|
-
return
|
|
49
|
+
return T_EXIT_FAIL;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
sqe = io_uring_get_sqe(&ring);
|
|
@@ -53,7 +54,7 @@ int main(int argc, char *argv[])
|
|
|
53
54
|
ret = io_uring_submit(&ring);
|
|
54
55
|
if (ret != 1) {
|
|
55
56
|
fprintf(stderr, "io_uring_submit1=%d\n", ret);
|
|
56
|
-
return
|
|
57
|
+
return T_EXIT_FAIL;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
|
|
@@ -62,7 +63,7 @@ int main(int argc, char *argv[])
|
|
|
62
63
|
ret = io_uring_wait_cqe_timeout(&ring, &cqe, &ts1);
|
|
63
64
|
if (ret) {
|
|
64
65
|
fprintf(stderr, "io_uring_wait_cqe_timeout=%d\n", ret);
|
|
65
|
-
return
|
|
66
|
+
return T_EXIT_FAIL;
|
|
66
67
|
}
|
|
67
68
|
io_uring_cqe_seen(&ring, cqe);
|
|
68
69
|
gettimeofday(&tv, NULL);
|
|
@@ -75,7 +76,7 @@ int main(int argc, char *argv[])
|
|
|
75
76
|
ret = io_uring_submit(&ring);
|
|
76
77
|
if (ret != 1) {
|
|
77
78
|
fprintf(stderr, "io_uring_submit2=%d\n", ret);
|
|
78
|
-
return
|
|
79
|
+
return T_EXIT_FAIL;
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
io_uring_wait_cqe(&ring, &cqe);
|
|
@@ -83,11 +84,11 @@ int main(int argc, char *argv[])
|
|
|
83
84
|
msec = mtime_since_now(&tv);
|
|
84
85
|
if (msec >= 900 && msec <= 1100) {
|
|
85
86
|
io_uring_queue_exit(&ring);
|
|
86
|
-
return
|
|
87
|
+
return T_EXIT_PASS;
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
fprintf(stderr, "%s: Timeout seems wonky (got %lu)\n", __FUNCTION__,
|
|
90
91
|
msec);
|
|
91
92
|
io_uring_queue_exit(&ring);
|
|
92
|
-
return
|
|
93
|
+
return T_EXIT_FAIL;
|
|
93
94
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#include <fcntl.h>
|
|
8
8
|
|
|
9
9
|
#include "liburing.h"
|
|
10
|
+
#include "helpers.h"
|
|
10
11
|
|
|
11
12
|
static int register_file(struct io_uring *ring)
|
|
12
13
|
{
|
|
@@ -85,12 +86,12 @@ int main(int argc, char *argv[])
|
|
|
85
86
|
int ret;
|
|
86
87
|
|
|
87
88
|
if (argc > 1)
|
|
88
|
-
return
|
|
89
|
+
return T_EXIT_SKIP;
|
|
89
90
|
|
|
90
91
|
ret = io_uring_queue_init(8, &ring, 0);
|
|
91
92
|
if (ret) {
|
|
92
93
|
printf("ring setup failed\n");
|
|
93
|
-
return
|
|
94
|
+
return T_EXIT_FAIL;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
ret = register_file(&ring);
|
|
@@ -102,5 +103,5 @@ int main(int argc, char *argv[])
|
|
|
102
103
|
return ret;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
return
|
|
106
|
+
return T_EXIT_PASS;
|
|
106
107
|
}
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
#include <unistd.h>
|
|
12
12
|
|
|
13
13
|
#include "liburing.h"
|
|
14
|
+
#include "helpers.h"
|
|
14
15
|
#include "../src/syscall.h"
|
|
15
16
|
|
|
16
17
|
int main(int argc, char *argv[])
|
|
17
18
|
{
|
|
18
19
|
if (argc > 1)
|
|
19
|
-
return
|
|
20
|
+
return T_EXIT_SKIP;
|
|
20
21
|
|
|
21
22
|
mmap((void *) 0x20000000, 0x1000000, 3, 0x32, -1, 0);
|
|
22
23
|
|
|
@@ -49,5 +50,5 @@ int main(int argc, char *argv[])
|
|
|
49
50
|
*(uint32_t*)0x2000006c = 0;
|
|
50
51
|
*(uint64_t*)0x20000070 = 0;
|
|
51
52
|
__sys_io_uring_setup(0x7a6, (struct io_uring_params *) 0x20000000UL);
|
|
52
|
-
return
|
|
53
|
+
return T_EXIT_PASS;
|
|
53
54
|
}
|
|
@@ -15,7 +15,7 @@ override CPPFLAGS += \
|
|
|
15
15
|
-I../src/include/ \
|
|
16
16
|
-include ../config-host.h
|
|
17
17
|
|
|
18
|
-
CFLAGS ?= -g -
|
|
18
|
+
CFLAGS ?= -g -O3 -Wall -Wextra
|
|
19
19
|
XCFLAGS = -Wno-unused-parameter -Wno-sign-compare
|
|
20
20
|
|
|
21
21
|
ifdef CONFIG_HAVE_STRINGOP_OVERFLOW
|
|
@@ -31,25 +31,27 @@ override CFLAGS += $(XCFLAGS) -DLIBURING_BUILD_TEST
|
|
|
31
31
|
override CXXFLAGS += $(XCFLAGS) -std=c++11 -DLIBURING_BUILD_TEST
|
|
32
32
|
|
|
33
33
|
LDFLAGS ?=
|
|
34
|
-
override LDFLAGS += -L../src/ -luring
|
|
34
|
+
override LDFLAGS += -L../src/ -luring -lpthread
|
|
35
35
|
|
|
36
|
+
# Please keep this list sorted alphabetically.
|
|
36
37
|
test_srcs := \
|
|
37
|
-
232c93d07b74
|
|
38
|
-
35fa71a030ca
|
|
39
|
-
500f9fbadef8
|
|
40
|
-
7ad0e4b2f83c
|
|
41
|
-
8a9973408177
|
|
42
|
-
917257daa0fe
|
|
43
|
-
a0908ae19763
|
|
44
|
-
a4c0b3decb33
|
|
38
|
+
232c93d07b74.c \
|
|
39
|
+
35fa71a030ca.c \
|
|
40
|
+
500f9fbadef8.c \
|
|
41
|
+
7ad0e4b2f83c.c \
|
|
42
|
+
8a9973408177.c \
|
|
43
|
+
917257daa0fe.c \
|
|
44
|
+
a0908ae19763.c \
|
|
45
|
+
a4c0b3decb33.c \
|
|
45
46
|
accept.c \
|
|
46
47
|
accept-link.c \
|
|
47
48
|
accept-reuse.c \
|
|
48
49
|
accept-test.c \
|
|
49
50
|
across-fork.c \
|
|
50
|
-
b19062a56726
|
|
51
|
-
b5837bd5311d
|
|
52
|
-
|
|
51
|
+
b19062a56726.c \
|
|
52
|
+
b5837bd5311d.c \
|
|
53
|
+
buf-ring.c \
|
|
54
|
+
ce593a6c480a.c \
|
|
53
55
|
close-opath.c \
|
|
54
56
|
connect.c \
|
|
55
57
|
cq-full.c \
|
|
@@ -57,12 +59,13 @@ test_srcs := \
|
|
|
57
59
|
cq-peek-batch.c \
|
|
58
60
|
cq-ready.c \
|
|
59
61
|
cq-size.c \
|
|
60
|
-
d4ae271dfaae
|
|
61
|
-
d77a67ed5f27
|
|
62
|
+
d4ae271dfaae.c \
|
|
63
|
+
d77a67ed5f27.c \
|
|
62
64
|
defer.c \
|
|
65
|
+
defer-taskrun.c \
|
|
63
66
|
double-poll-crash.c \
|
|
64
67
|
drop-submit.c \
|
|
65
|
-
eeed8b54e0df
|
|
68
|
+
eeed8b54e0df.c \
|
|
66
69
|
empty-eownerdead.c \
|
|
67
70
|
eventfd.c \
|
|
68
71
|
eventfd-disable.c \
|
|
@@ -72,19 +75,24 @@ test_srcs := \
|
|
|
72
75
|
exit-no-cleanup.c \
|
|
73
76
|
fadvise.c \
|
|
74
77
|
fallocate.c \
|
|
75
|
-
fc2a85cb02ef
|
|
78
|
+
fc2a85cb02ef.c \
|
|
79
|
+
fd-pass.c \
|
|
76
80
|
file-register.c \
|
|
77
81
|
files-exit-hang-poll.c \
|
|
78
82
|
files-exit-hang-timeout.c \
|
|
79
83
|
file-update.c \
|
|
80
84
|
file-verify.c \
|
|
85
|
+
fixed-buf-iter.c \
|
|
81
86
|
fixed-link.c \
|
|
87
|
+
fixed-reuse.c \
|
|
82
88
|
fpos.c \
|
|
83
89
|
fsync.c \
|
|
84
90
|
hardlink.c \
|
|
85
91
|
io-cancel.c \
|
|
86
92
|
iopoll.c \
|
|
93
|
+
iopoll-leak.c \
|
|
87
94
|
io_uring_enter.c \
|
|
95
|
+
io_uring_passthrough.c \
|
|
88
96
|
io_uring_register.c \
|
|
89
97
|
io_uring_setup.c \
|
|
90
98
|
lfs-openat.c \
|
|
@@ -96,26 +104,36 @@ test_srcs := \
|
|
|
96
104
|
mkdir.c \
|
|
97
105
|
msg-ring.c \
|
|
98
106
|
multicqes_drain.c \
|
|
107
|
+
nolibc.c \
|
|
99
108
|
nop-all-sizes.c \
|
|
100
109
|
nop.c \
|
|
101
110
|
openat2.c \
|
|
102
111
|
open-close.c \
|
|
112
|
+
open-direct-link.c \
|
|
113
|
+
open-direct-pick.c \
|
|
103
114
|
personality.c \
|
|
104
115
|
pipe-eof.c \
|
|
105
116
|
pipe-reuse.c \
|
|
106
117
|
poll.c \
|
|
107
118
|
poll-cancel.c \
|
|
119
|
+
poll-cancel-all.c \
|
|
108
120
|
poll-cancel-ton.c \
|
|
109
121
|
poll-link.c \
|
|
110
122
|
poll-many.c \
|
|
111
123
|
poll-mshot-update.c \
|
|
124
|
+
poll-mshot-overflow.c \
|
|
112
125
|
poll-ring.c \
|
|
113
126
|
poll-v-poll.c \
|
|
114
127
|
pollfree.c \
|
|
115
128
|
probe.c \
|
|
129
|
+
read-before-exit.c \
|
|
116
130
|
read-write.c \
|
|
131
|
+
recv-msgall.c \
|
|
132
|
+
recv-msgall-stream.c \
|
|
133
|
+
recv-multishot.c \
|
|
117
134
|
register-restrictions.c \
|
|
118
135
|
rename.c \
|
|
136
|
+
ringbuf-read.c \
|
|
119
137
|
ring-leak2.c \
|
|
120
138
|
ring-leak.c \
|
|
121
139
|
rsrc_tags.c \
|
|
@@ -128,6 +146,8 @@ test_srcs := \
|
|
|
128
146
|
short-read.c \
|
|
129
147
|
shutdown.c \
|
|
130
148
|
sigfd-deadlock.c \
|
|
149
|
+
skip-cqe.c \
|
|
150
|
+
socket.c \
|
|
131
151
|
socket-rw.c \
|
|
132
152
|
socket-rw-eagain.c \
|
|
133
153
|
socket-rw-offset.c \
|
|
@@ -143,88 +163,60 @@ test_srcs := \
|
|
|
143
163
|
sqpoll-sleep.c \
|
|
144
164
|
sq-space_left.c \
|
|
145
165
|
stdout.c \
|
|
166
|
+
submit-and-wait.c \
|
|
146
167
|
submit-link-fail.c \
|
|
147
168
|
submit-reuse.c \
|
|
169
|
+
sync-cancel.c \
|
|
148
170
|
symlink.c \
|
|
149
171
|
teardowns.c \
|
|
150
172
|
thread-exit.c \
|
|
151
173
|
timeout.c \
|
|
152
174
|
timeout-new.c \
|
|
153
175
|
timeout-overflow.c \
|
|
176
|
+
tty-write-dpoll.c \
|
|
154
177
|
unlink.c \
|
|
155
178
|
wakeup-hang.c \
|
|
179
|
+
xattr.c \
|
|
156
180
|
skip-cqe.c \
|
|
181
|
+
single-issuer.c \
|
|
182
|
+
send-zerocopy.c \
|
|
157
183
|
# EOL
|
|
158
184
|
|
|
159
|
-
|
|
160
185
|
all_targets :=
|
|
161
186
|
include ../Makefile.quiet
|
|
162
187
|
|
|
163
|
-
|
|
164
188
|
ifdef CONFIG_HAVE_STATX
|
|
165
189
|
test_srcs += statx.c
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
ifdef CONFIG_HAVE_GLIBC_STATX
|
|
190
|
+
else ifdef CONFIG_HAVE_GLIBC_STATX
|
|
169
191
|
test_srcs += statx.c
|
|
170
192
|
endif
|
|
171
|
-
all_targets += statx
|
|
172
|
-
|
|
193
|
+
all_targets += statx.t
|
|
173
194
|
|
|
174
195
|
ifdef CONFIG_HAVE_CXX
|
|
175
196
|
test_srcs += sq-full-cpp.cc
|
|
176
197
|
endif
|
|
177
|
-
all_targets += sq-full-cpp
|
|
198
|
+
all_targets += sq-full-cpp.t
|
|
178
199
|
|
|
179
200
|
|
|
180
|
-
test_targets := $(patsubst %.c,%,$(
|
|
201
|
+
test_targets := $(patsubst %.c,%,$(test_srcs))
|
|
202
|
+
test_targets := $(patsubst %.cc,%,$(test_targets))
|
|
203
|
+
run_test_targets := $(patsubst %,%.run_test,$(test_targets))
|
|
204
|
+
test_targets := $(patsubst %,%.t,$(test_targets))
|
|
181
205
|
all_targets += $(test_targets)
|
|
182
|
-
|
|
183
|
-
#
|
|
184
|
-
# Build ../src/syscall.c manually from test's Makefile to support
|
|
185
|
-
# liburing nolibc.
|
|
186
|
-
#
|
|
187
|
-
# Functions in ../src/syscall.c require libc to work with, if we
|
|
188
|
-
# build liburing without libc, we don't have those functions
|
|
189
|
-
# in liburing.a. So build it manually here.
|
|
190
|
-
#
|
|
191
|
-
helpers = helpers.o ../src/syscall.o
|
|
206
|
+
helpers = helpers.o
|
|
192
207
|
|
|
193
208
|
all: $(test_targets)
|
|
194
209
|
|
|
195
|
-
../src/syscall.o: ../src/syscall.c
|
|
196
|
-
$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
|
|
197
|
-
|
|
198
210
|
helpers.o: helpers.c
|
|
199
211
|
$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
|
|
200
212
|
|
|
201
|
-
|
|
213
|
+
%.t: %.c $(helpers) helpers.h ../src/liburing.a
|
|
202
214
|
$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(helpers) $(LDFLAGS)
|
|
203
215
|
|
|
204
|
-
|
|
216
|
+
%.t: %.cc $(helpers) helpers.h ../src/liburing.a
|
|
205
217
|
$(QUIET_CXX)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(helpers) $(LDFLAGS)
|
|
206
218
|
|
|
207
219
|
|
|
208
|
-
35fa71a030ca-test: override LDFLAGS += -lpthread
|
|
209
|
-
232c93d07b74-test: override LDFLAGS += -lpthread
|
|
210
|
-
send_recv: override LDFLAGS += -lpthread
|
|
211
|
-
send_recvmsg: override LDFLAGS += -lpthread
|
|
212
|
-
poll-link: override LDFLAGS += -lpthread
|
|
213
|
-
accept-link: override LDFLAGS += -lpthread
|
|
214
|
-
submit-reuse: override LDFLAGS += -lpthread
|
|
215
|
-
poll-v-poll: override LDFLAGS += -lpthread
|
|
216
|
-
across-fork: override LDFLAGS += -lpthread
|
|
217
|
-
ce593a6c480a-test: override LDFLAGS += -lpthread
|
|
218
|
-
wakeup-hang: override LDFLAGS += -lpthread
|
|
219
|
-
pipe-eof: override LDFLAGS += -lpthread
|
|
220
|
-
timeout-new: override LDFLAGS += -lpthread
|
|
221
|
-
thread-exit: override LDFLAGS += -lpthread
|
|
222
|
-
ring-leak2: override LDFLAGS += -lpthread
|
|
223
|
-
poll-mshot-update: override LDFLAGS += -lpthread
|
|
224
|
-
exit-no-cleanup: override LDFLAGS += -lpthread
|
|
225
|
-
pollfree: override LDFLAGS += -lpthread
|
|
226
|
-
msg-ring: override LDFLAGS += -lpthread
|
|
227
|
-
|
|
228
220
|
install: $(test_targets) runtests.sh runtests-loop.sh
|
|
229
221
|
$(INSTALL) -D -d -m 755 $(datadir)/liburing-test/
|
|
230
222
|
$(INSTALL) -D -m 755 $(test_targets) $(datadir)/liburing-test/
|
|
@@ -241,4 +233,10 @@ runtests: all
|
|
|
241
233
|
runtests-loop: all
|
|
242
234
|
@./runtests-loop.sh $(test_targets)
|
|
243
235
|
|
|
244
|
-
|
|
236
|
+
%.run_test: %.t
|
|
237
|
+
@./runtests-quiet.sh $<
|
|
238
|
+
|
|
239
|
+
runtests-parallel: $(run_test_targets)
|
|
240
|
+
@echo "All tests passed"
|
|
241
|
+
|
|
242
|
+
.PHONY: all install clean runtests runtests-loop runtests-parallel
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include <unistd.h>
|
|
12
12
|
|
|
13
13
|
#include "liburing.h"
|
|
14
|
+
#include "helpers.h"
|
|
14
15
|
#include "../src/syscall.h"
|
|
15
16
|
|
|
16
17
|
uint64_t r[1] = {0xffffffffffffffff};
|
|
@@ -18,7 +19,7 @@ uint64_t r[1] = {0xffffffffffffffff};
|
|
|
18
19
|
int main(int argc, char *argv[])
|
|
19
20
|
{
|
|
20
21
|
if (argc > 1)
|
|
21
|
-
return
|
|
22
|
+
return T_EXIT_SKIP;
|
|
22
23
|
mmap((void *) 0x20000000, 0x1000000, 3, 0x32, -1, 0);
|
|
23
24
|
intptr_t res = 0;
|
|
24
25
|
*(uint32_t*)0x20000080 = 0;
|
|
@@ -54,5 +55,5 @@ int main(int argc, char *argv[])
|
|
|
54
55
|
r[0] = res;
|
|
55
56
|
*(uint32_t*)0x20000280 = -1;
|
|
56
57
|
__sys_io_uring_register(r[0], 2, (const void *) 0x20000280, 1);
|
|
57
|
-
return
|
|
58
|
+
return T_EXIT_PASS;
|
|
58
59
|
}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
#include <unistd.h>
|
|
22
22
|
|
|
23
23
|
#include "liburing.h"
|
|
24
|
+
#include "helpers.h"
|
|
24
25
|
#include "../src/syscall.h"
|
|
25
26
|
|
|
26
27
|
static void sleep_ms(uint64_t ms)
|
|
@@ -172,9 +173,9 @@ static void sig_int(int sig)
|
|
|
172
173
|
int main(int argc, char *argv[])
|
|
173
174
|
{
|
|
174
175
|
if (argc > 1)
|
|
175
|
-
return
|
|
176
|
+
return T_EXIT_SKIP;
|
|
176
177
|
signal(SIGINT, sig_int);
|
|
177
178
|
mmap((void *) 0x20000000, 0x1000000, 3, 0x32, -1, 0);
|
|
178
179
|
loop();
|
|
179
|
-
return
|
|
180
|
+
return T_EXIT_PASS;
|
|
180
181
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#include <arpa/inet.h>
|
|
15
15
|
|
|
16
16
|
#include "liburing.h"
|
|
17
|
+
#include "helpers.h"
|
|
17
18
|
|
|
18
19
|
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
19
20
|
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
|
|
@@ -239,16 +240,16 @@ static int test_accept_timeout(int do_connect, unsigned long timeout)
|
|
|
239
240
|
int main(int argc, char *argv[])
|
|
240
241
|
{
|
|
241
242
|
if (argc > 1)
|
|
242
|
-
return
|
|
243
|
+
return T_EXIT_SKIP;
|
|
243
244
|
if (test_accept_timeout(0, 200000000)) {
|
|
244
245
|
fprintf(stderr, "accept timeout 0 failed\n");
|
|
245
|
-
return
|
|
246
|
+
return T_EXIT_FAIL;
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
if (test_accept_timeout(1, 1000000000)) {
|
|
249
250
|
fprintf(stderr, "accept and connect timeout 0 failed\n");
|
|
250
|
-
return
|
|
251
|
+
return T_EXIT_FAIL;
|
|
251
252
|
}
|
|
252
253
|
|
|
253
|
-
return
|
|
254
|
+
return T_EXIT_PASS;
|
|
254
255
|
}
|