summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-05-14 20:11:43 -0600
committerJens Axboe <axboe@kernel.dk>2019-05-14 20:11:43 -0600
commitbb2c80ff0f7834691c892b6ea38114603b20abbe (patch)
tree6cb33c289d2b7718ca901e6f85f7fbbf852e1fbd /test
parent1982bfd44dc3b4b6dad7885fbf708d2bf1dc7ebf (diff)
test/io_uring_register: don't fail max fd test if we run out of mem
We need a lot of RAM for this case, my vm always fails it. Don't hard fail due to ENOMEM, just skip the test. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r--test/io_uring_register.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/io_uring_register.c b/test/io_uring_register.c
index 0ffdee7..7adf563 100644
--- a/test/io_uring_register.c
+++ b/test/io_uring_register.c
@@ -133,6 +133,10 @@ test_max_fds(int uring_fd)
fd_as = mmap(NULL, UINT_MAX * sizeof(int), PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
if (fd_as == MAP_FAILED) {
+ if (errno == ENOMEM) {
+ printf("Not enough memory for this test, skipping\n");
+ return 0;
+ }
perror("mmap fd_as");
exit(1);
}