MCPcopy Create free account
hub / github.com/axboe/liburing / test_update_multiring

Function test_update_multiring

test/file-update.c:63–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63static int test_update_multiring(struct io_uring *r1, struct io_uring *r2,
64 struct io_uring *r3, int do_unreg)
65{
66 int *fds, *newfds;
67
68 fds = open_files(10, 0, 0);
69 newfds = open_files(10, 0, 1);
70
71 if (io_uring_register_files(r1, fds, 10) ||
72 io_uring_register_files(r2, fds, 10) ||
73 io_uring_register_files(r3, fds, 10)) {
74 fprintf(stderr, "%s: register files failed\n", __FUNCTION__);
75 goto err;
76 }
77
78 if (io_uring_register_files_update(r1, 0, newfds, 10) != 10 ||
79 io_uring_register_files_update(r2, 0, newfds, 10) != 10 ||
80 io_uring_register_files_update(r3, 0, newfds, 10) != 10) {
81 fprintf(stderr, "%s: update files failed\n", __FUNCTION__);
82 goto err;
83 }
84
85 if (!do_unreg)
86 goto done;
87
88 if (io_uring_unregister_files(r1) ||
89 io_uring_unregister_files(r2) ||
90 io_uring_unregister_files(r3)) {
91 fprintf(stderr, "%s: unregister files failed\n", __FUNCTION__);
92 goto err;
93 }
94
95done:
96 close_files(fds, 10, 0);
97 close_files(newfds, 10, 1);
98 return 0;
99err:
100 close_files(fds, 10, 0);
101 close_files(newfds, 10, 1);
102 return 1;
103}
104
105static int test_sqe_update(struct io_uring *ring)
106{

Callers 1

mainFunction · 0.85

Calls 5

io_uring_register_filesFunction · 0.85
open_filesFunction · 0.70
close_filesFunction · 0.70

Tested by

no test coverage detected