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

Function main

examples/link-cp.c:155–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155int 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}

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