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

Function test_replace

test/file-register.c:194–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194static int test_replace(struct io_uring *ring)
195{
196 int *files, *fds = NULL;
197 int ret;
198
199 files = open_files(100, 0, 0);
200 ret = io_uring_register_files(ring, files, 100);
201 if (ret) {
202 fprintf(stderr, "%s: register ret=%d\n", __FUNCTION__, ret);
203 goto err;
204 }
205
206 fds = open_files(10, 0, 1);
207 ret = io_uring_register_files_update(ring, 90, fds, 10);
208 if (ret != 10) {
209 fprintf(stderr, "%s: update ret=%d\n", __FUNCTION__, ret);
210 goto err;
211 }
212
213 ret = io_uring_unregister_files(ring);
214 if (ret) {
215 fprintf(stderr, "%s: unregister ret=%d\n", __FUNCTION__, ret);
216 goto err;
217 }
218
219 close_files(files, 100, 0);
220 if (fds)
221 close_files(fds, 10, 1);
222 return 0;
223err:
224 close_files(files, 100, 0);
225 if (fds)
226 close_files(fds, 10, 1);
227 return 1;
228}
229
230static int test_removals(struct io_uring *ring)
231{

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