| 153 | } |
| 154 | |
| 155 | int main(int argc, char *argv[]) |
| 156 | { |
| 157 | struct io_uring ring; |
| 158 | off_t insize; |
| 159 | int ret; |
| 160 | |
| 161 | if (argc < 3) { |
| 162 | printf("%s: infile outfile\n", argv[0]); |
| 163 | return 1; |
| 164 | } |
| 165 | |
| 166 | infd = open(argv[1], O_RDONLY); |
| 167 | if (infd < 0) { |
| 168 | perror("open infile"); |
| 169 | return 1; |
| 170 | } |
| 171 | outfd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644); |
| 172 | if (outfd < 0) { |
| 173 | perror("open outfile"); |
| 174 | return 1; |
| 175 | } |
| 176 | |
| 177 | if (setup_context(QD, &ring)) |
| 178 | return 1; |
| 179 | if (get_file_size(infd, &insize)) |
| 180 | return 1; |
| 181 | |
| 182 | ret = copy_file(&ring, insize); |
| 183 | |
| 184 | close(infd); |
| 185 | close(outfd); |
| 186 | io_uring_queue_exit(&ring); |
| 187 | return ret; |
| 188 | } |
nothing calls this directly
no test coverage detected