Age | Commit message (Collapse) | Author |
|
Warned-by: gcc -Wsign-compare
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
The usual convention is that the various *FLAGS are user controllable,
and can be overridden, so anything that is essential for the build
should be passed respecting that. The other usual convention is that
CPPFLAGS only contain pre-processor options, CFLAGS and CXXFLAGS only
contain compilation options and LDFLAGS only contain linker flags,
where all of these are honored in all build rules.
Switch to set optional flags conditionally into the *FLAGS variables if
they are not set, and then unconditionally append any required flags.
And pass the various *FLAGS to the rules as expected.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
Needed for e.g. musl libc which only includes entities like
cpu_set_t if this is defined.
Signed-off-by: Uman Shahzad <uman@mslm.io>
|
|
Signed-off-by: David Disseldorp <ddiss@suse.de>
|
|
The size of C arrays at file scope must be constant. The following
compiler error occurs with recent upstream glibc (2.33.9000):
CC ucontext-cp
ucontext-cp.c:31:23: error: variably modified ‘stack_buf’ at file scope
31 | unsigned char stack_buf[SIGSTKSZ];
| ^~~~~~~~~
make[1]: *** [Makefile:26: ucontext-cp] Error 1
The following glibc commit changed SIGSTKSZ from a constant value to a
variable:
commit 6c57d320484988e87e446e2e60ce42816bf51d53
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Feb 1 11:00:38 2021 -0800
sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305]
...
+# define SIGSTKSZ sysconf (_SC_SIGSTKSZ)
Allocate the stack buffer explicitly to avoid declaring an array at file
scope.
Cc: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We could be ending the loop with all reads done, but with pending writes
that we haven't waited for yet. Ensure that we do so.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
The header file `ucontext.h` is not available on musl based distros. The
example `ucontext-cp` is not built if `configure` fails to locate the
header.
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Split preprocessor flags into CPPFLAGS to be passed to rules involving
code compilation, instead of link-only rules. This also guarantees we
always use the user set CPPFLAGS which are expected to be honored by
most build systems. Move build system required C++ flags into an
override for CXXFLAGS to follow the same pattern as the other flags.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
The example currently assumes the file is at least 4*4096 bytes,
and errors when we get 0 reads on EOF. Fix this up.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Use ./configure --cc=whatever to set the compiler.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
ucontext-cp.c:24:0: warning: "SIGSTKSZ" redefined
#define SIGSTKSZ 8192
In file included from /usr/include/signal.h:316:0,
from ucontext-cp.c:13:
/usr/include/aarch64-linux-gnu/bits/sigstack.h:30:0: note: this is the location of the previous definition
#define SIGSTKSZ 16384
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also unify across subdirs.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Allow multiple files being copied in one command, and print more logs
Also add timeout to indicate that different coroutines run in parallel actually
Signed-off-by: 李通洲 <carter.li@eoitek.com>
|
|
Signed-off-by: James Rouzier <rouzier@gmail.com>
|
|
No functional changes.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Coroutines are often used to simplify async programming,
and work great with liburing.
`ucontext` doesn't perform very good, but it's enough for an example.
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
It is not possible to install barrier.h and compat.h into the top-level
/usr/include directly since they are likely to conflict with other
software. io_uring.h could be confused with the system's kernel header
file.
Put liburing headers into <liburing/*.h> so there is no chance of
conflicts or confusion.
Existing applications continue to build successfully since the location
of <liburing.h> is unchanged. In-tree examples and tests require
modification because src/liburing.h is moved to src/include/liburing.h.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This patch makes the liburing build work as expected for e.g. the following
command:
make CFLAGS=-m32
and avoids that the build fails as follows for the above command:
make[1]: Entering directory 'liburing/test'
cc -m32 -o poll poll.c -luring
/usr/bin/ld: cannot find -luring
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'poll' failed
make[1]: *** [poll] Error 1
make[1]: Leaving directory 'software/liburing/test'
Makefile:12: recipe for target 'all' failed
make: *** [all] Error 2
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This example misses an increment though the iovecs array. This causes
the same buffer to be filled from the block device every time. It would
be good to fix this since it is one of the first examples a new-comer to
io_uring is exposed too.
Signed-off-by: Stephen Bates <sbates@raithlin.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
In case malloc fails, the fix returns NULL to avoid NULL pointer
dereference.
Signed-off-by: zhangliguang <zhangliguang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Put the data at the end so we don't have to offset the actual buffer.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Add short read requeue and abort on error.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Still need to handle broken chains, must resubmit those.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Just a basic test case that does various forms of linked nops, and
a sample bare bones copy program using linked reads and writes.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We have io_uring_get_sqe() on the submission side, yet the completion
side is named _completion. Rename as follows:
io_uring_get_completion() io_uring_peek_cqe()
iO_uring_wait_completion() io_uring_wait_cqe()
This better tells the user what the _get variant does by calling it
_peek instead, and we move to using _cqe() as the postfix instead
of _completion.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also adds a runtests makefile target.
|