Silences the following:
* Error due to no definition for `mode_t` in `liburing.h`
* Warning due to use of non-portable `#include <sys/poll.h>` and `#include <sys/signal.h>`
* Warning due to incorrect `printf` format specifier in `test/io_uring_register.c`
* Error due to missing declaration for `strcpy` in `test/sendmsg_fs_cve.c`
* Error due to missing declaration for `strerror` in `test/shutdown.c`
Signed-off-by: Mahdi Rakhshandehroo <mahdi.rakhshandehroo@gmail.com>
When I add support for nolibc x86-64, I find this test failed.
Long story short, we provide our own `free()` that always unmaps the VM
with `munmap()`. It makes the CQE return -EFAULT because the kernel
reads unmapped user memory from the pending `write()` SQE.
I believe this test can run properly with libc build because `free()`
from libc doesn't always unmap the memory, instead it uses free list on
the userspace and the freed heap may still be userspace addressable.
Fix this by deferring the free.
Cc: Jens Axboe <axboe@kernel.dk>
Fixes: 366766bae8 ("Add test case for thread exiting with pending IO")
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/20211010063906.341014-2-ammar.faizi@students.amikom.ac.id
Signed-off-by: Jens Axboe <axboe@kernel.dk>
As brought up in an issue, this makes it confusing as to what could
potentially be liburing functions. Make it clear that these are test
helpers, hence use the t_ prefix for them.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
cleanup: add io_uring_create_file() helper,
and replace create_file() with io_uring_calloc() in tests.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
As axboe said, Right now a lot of basic stuff is duplicated,
and it makes the tests bigger than they should be.
Here, we try to add helpers.h which will contains various
utilities that tests could use, then that'd help make tests simpler.
In this patch, we just add one helper io_uring_malloc(), which
will call assert() if allocating memory fails.
We will add more helpers in subsequent patches
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
A thread exiting should not have its IO canceled, that should only happen
when the parent exits. Test that we are able to issue IO from a thread,
with the parent reaping the completion when the thread exits.
Signed-off-by: Jens Axboe <axboe@kernel.dk>