On filesystems such as tmpfs the syscall might return -ENOTSUP instead
of EINVAL when it does not support the RWF_NOWAIT flag.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Gbp-Pq: Name 0005-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch
ret = io_submit(ctx, 1, &iocbp);
/*
- * io_submit will return -EINVAL if RWF_NOWAIT is not supported.
+ * io_submit will return -EINVAL or -ENOTSUP if RWF_NOWAIT is not
+ * supported.
*/
if (ret != 1) {
- if (ret == -EINVAL) {
+ if (ret == -EINVAL || ret == -ENOTSUP) {
fprintf(stderr, "RWF_NOWAIT not supported by kernel.\n");
/* just return success */
return 0;