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

Function do_mkdirat

test/mkdir.c:15–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "helpers.h"
14
15static int do_mkdirat(struct io_uring *ring, const char *fn)
16{
17 int ret;
18 struct io_uring_sqe *sqe;
19 struct io_uring_cqe *cqe;
20
21 sqe = io_uring_get_sqe(ring);
22 if (!sqe) {
23 fprintf(stderr, "sqe get failed\n");
24 goto err;
25 }
26 io_uring_prep_mkdirat(sqe, AT_FDCWD, fn, 0700);
27
28 ret = io_uring_submit(ring);
29 if (ret != 1) {
30 fprintf(stderr, "submit failed: %d\n", ret);
31 goto err;
32 }
33
34 ret = io_uring_wait_cqes(ring, &cqe, 1, 0, 0);
35 if (ret) {
36 fprintf(stderr, "wait_cqe failed: %d\n", ret);
37 goto err;
38 }
39 ret = cqe->res;
40 io_uring_cqe_seen(ring, cqe);
41 return ret;
42err:
43 return 1;
44}
45
46static int stat_file(const char *fn)
47{

Callers 1

mainFunction · 0.85

Calls 3

io_uring_submitFunction · 0.85
io_uring_wait_cqesFunction · 0.85
io_uring_get_sqeFunction · 0.50

Tested by

no test coverage detected