Skip to content

Commit 797a0e7

Browse files
Richard Palethorpemetan-ucw
authored andcommitted
io_pgetevents{01,02}: Handle no AIO support
Signed-off-by: Richard Palethorpe <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent cc1ac88 commit 797a0e7

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

testcases/kernel/syscalls/io_pgetevents/io_pgetevents01.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ static void run(void)
5151
fd = SAFE_OPEN("io_pgetevents_file", O_RDWR | O_CREAT, 0644);
5252
io_prep_pwrite(&cb, fd, data, 4096, 0);
5353

54-
ret = io_setup(1, &ctx);
55-
if (ret < 0)
56-
tst_brk(TBROK | TERRNO, "io_setup() failed");
54+
TEST(io_setup(1, &ctx));
55+
if (TST_RET == -ENOSYS)
56+
tst_brk(TCONF | TRERRNO, "io_setup(): AIO not supported by kernel");
57+
if (TST_RET < 0)
58+
tst_brk(TBROK | TRERRNO, "io_setup() failed");
5759

5860
ret = io_submit(ctx, 1, cbs);
5961
if (ret != 1)

testcases/kernel/syscalls/io_pgetevents/io_pgetevents02.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ static void setup(void)
6565
fd = SAFE_OPEN("io_pgetevents_file", O_RDWR | O_CREAT, 0644);
6666
io_prep_pwrite(&cb, fd, data, 4096, 0);
6767

68-
ret = io_setup(1, &ctx);
69-
if (ret < 0)
70-
tst_brk(TBROK | TERRNO, "io_setup() failed");
68+
TEST(io_setup(1, &ctx));
69+
if (TST_RET == -ENOSYS)
70+
tst_brk(TCONF | TRERRNO, "io_setup(): AIO not supported by kernel");
71+
if (TST_RET < 0)
72+
tst_brk(TBROK | TRERRNO, "io_setup() failed");
7173

7274
ctx_initialized = 1;
7375

0 commit comments

Comments
 (0)