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

Function main

examples/io_uring-cp.c:249–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249int main(int argc, char *argv[])
250{
251 struct io_uring ring;
252 off_t insize;
253 int ret;
254
255 if (argc < 3) {
256 printf("%s: infile outfile\n", argv[0]);
257 return 1;
258 }
259
260 infd = open(argv[1], O_RDONLY);
261 if (infd < 0) {
262 perror("open infile");
263 return 1;
264 }
265 outfd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644);
266 if (outfd < 0) {
267 perror("open outfile");
268 return 1;
269 }
270
271 if (setup_context(QD, &ring))
272 return 1;
273 if (get_file_size(infd, &insize))
274 return 1;
275
276 ret = copy_file(&ring, insize);
277
278 close(infd);
279 close(outfd);
280 io_uring_queue_exit(&ring);
281 return ret;
282}

Callers

nothing calls this directly

Calls 4

io_uring_queue_exitFunction · 0.85
setup_contextFunction · 0.70
get_file_sizeFunction · 0.70
copy_fileFunction · 0.70

Tested by

no test coverage detected