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

Function test_invalid_sig

test/reg-wait.c:73–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71static struct io_uring_reg_wait *reg;
72
73static int test_invalid_sig(struct io_uring *ring)
74{
75 struct io_uring_cqe *cqe;
76 sigset_t sig;
77 int ret;
78
79 memset(reg, 0, sizeof(*reg));
80 reg->ts.tv_sec = 1;
81 reg->ts.tv_nsec = 0;
82 reg->sigmask = (unsigned long) &sig;
83 reg->sigmask_sz = 1;
84
85 ret = io_uring_submit_and_wait_reg(ring, &cqe, 1, 0);
86 if (ret != -EINVAL) {
87 fprintf(stderr, "sigmask_sz failed: %d\n", ret);
88 return T_EXIT_FAIL;
89 }
90
91 memset(reg, 0, sizeof(*reg));
92 reg->ts.tv_sec = 1;
93 reg->ts.tv_nsec = 0;
94 reg->sigmask = 100;
95 reg->sigmask_sz = 8;
96
97 ret = io_uring_submit_and_wait_reg(ring, &cqe, 1, 0);
98 if (ret != -EFAULT) {
99 fprintf(stderr, "sigmask invalid failed: %d\n", ret);
100 return T_EXIT_FAIL;
101 }
102
103 return T_EXIT_PASS;
104}
105
106static int test_offsets(struct io_uring *ring, struct io_uring_reg_wait *base,
107 size_t size, bool overallocated)

Callers 1

test_wait_argFunction · 0.85

Calls 1

Tested by

no test coverage detected