| 247 | } |
| 248 | |
| 249 | int 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 | } |
nothing calls this directly
no test coverage detected