Improve error reporting when io_uring is unavailable

Ref #55
parent 2fd8f339
......@@ -239,6 +239,7 @@ try_flag(unsigned flag)
{
struct io_uring_params params;
struct io_uring ring;
const char *e;
int ret;
memset(&params, 0, sizeof params);
......@@ -250,8 +251,15 @@ try_flag(unsigned flag)
return (flag);
}
assert(ret == -EINVAL);
return (0);
if (ret == -EINVAL)
return (0);
e = strerror(0 - ret);
if (e == NULL)
e = "NIL";
fprintf(stderr, "fellow: io_uring try: FATAL, got %d (%s)\n", ret, e);
errno = 0 - ret;
WRONG("Unexpected io_uring error. Is it available?");
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment