Age | Commit message (Collapse) | Author |
|
On Travis (and only on Travis) this test crashes. It hits an internal
assertion within glibc. It happens reliably with rustc 1.37.0. Ignore
the test until Travis updates its images; then we'll try again.
Issue #1099
|
|
|
|
It helps deal with errors like EAGAIN, which can result in a subset of
an LioCb's operations being queued. The test is only enabled on
FreeBSD, because it requires intimate knowledge of AIO system limits.
|
|
Supporting the bytes crate was unnecessarily specific. This change
replaces from_bytes and from_bytes_mut with from_boxed_slice and
from_boxed_mut_slice, which can work with anything that implements
Borrow<[u8]> and BorrowMut<[u8]>, respectively.
|
|
The new LioCb structure allows us to control the exact arguments passed
to lio_listio, guaranteeing that each call gets a unique storage
location for the list argument. This prevents clients from misusing
lio_listio in a way that causes events to get dropped from a kqueue
Fixes #870
|
|
|
|
|
|
It's not actually safe to read into an `Rc<[u8]>`. It only worked
because of a coincidental `unsafe` block. Replace that type with
`BytesMut` from the bytes crate. For consistency's sake, use `Bytes`
for writing too, and completely remove methods relating to `Rc<[u8]>`.
Note that the `AioCb` will actually own the `BytesMut` object. The
caller must call `into_buffer` to get it back once the I/O is complete.
Fixes #788
|
|
|
|
Reads a little bit easier
|
|
Makes it more clear what's being cloned
|
|
|
|
It's unclear why these were static in the first place.
|
|
As of Rust 1.17 'static lifetimes are implied when
declaring consts.
|
|
Several tests make the assumption that all data is written, which
is not guaranteed with write(), so use write_all() instead.
|
|
The libc_bitflags! macro was replaced with a non-recursive one supporting
only public structs. I could not figure out how to make the old macro work
with the upgrade, so I reworked part of the bitflags! macro directly to suit
our needs, much as the original recursive macro was made. There are no uses
of this macro for non-public structs, so this is not a problem for internal code.
|
|
773: Add more accessors for AioCb r=asomers a=asomers
|
|
This fixes the following warning during run of cargo test
warning: variable does not need to be mutable
--> test/sys/test_aio.rs:16:13
|
16 | fn poll_aio(mut aiocb: &mut AioCb) -> Result<()> {
| ^^^^^^^^^
|
= note: #[warn(unused_mut)] on by default
|
|
|
|
Previously, the `AioCb`'s `in_progress` field would erroneously be set
to `true`, even if the syscall had an error
Fixes #714
|
|
Printing a warning message to stderr isn't really appropriate, because
there's no way to guarantee that stderr is even valid. Nor is
aio_suspend necessarily an appropriate action to take.
|
|
These are assumed to be QEMU issues, as they also fail on mips.
|
|
Note that this is now only available for Linux as support is missing in libc
for Android (see rust-lang/libc#671).
As part of this work the SIGUSR2 signal mutex was altered to be a general
signal mutex. This is because all signal handling is shared across all threads
in the Rust test harness, so if you alter one signal, depending on whether it's
additive or may overwrite the mask for other signals, it could break the other
ones. Instead of putting this on the user, just broaden the scope of the mutex
so that any altering of signal handling needs to use it.
|
|
They have four problems:
* The chdir tests change the process's cwd, which is global. Protect them
all with a mutex.
* The wait tests will reap any subprocess, and several tests create
subprocesses. Protect them all with a mutex so only one
subprocess-creating test will run at a time.
* When a multithreaded test forks, the child process can sometimes block in
the stack unwinding code. It blocks on a mutex that was held by a
different thread in the parent, but that thread doesn't exist in the
child, so a deadlock results. Fix this by immediately calling
std::process:exit in the child processes.
* My previous attempt at thread safety in the aio tests didn't work, because
anonymous MutexGuards drop immediately. Fix this by naming the
SIGUSR2_MTX MutexGuards.
Fixes #251
|
|
Seems that pretty much all aio tests fail on x64 musl builds.
|
|
|
|
|
|
The existing AioCb constructors work for simple programs where
everything is stored on the stack. But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it. Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.
Fixes #575
|
|
Adds a mutex to protect access to SIGUSR2 signal handlers by the AIO
tests.
Fixes #578
|
|
Also, fix style bug in AIO tests
|
|
If an AioCb has any in-kernel state, AioCb.drop will print a warning and
wait for it to complete.
|
|
Prevent immutable buffers from being used with aio_read or lio_listio
with LIO_READ. AioCb.from_slice no longer needs to be unsafe.
|
|
|
|
|
|
POSIX AIO is a standard for asynchronous file I/O. Read, write, and
fsync operations can all take place in the background, with completion
notification delivered by a signal, by a new thread, by kqueue, or not
at all. This commit supports all standard AIO functions. However,
lio_listio is disabled on macos because it doesn't seem to work, even
though the syscall is present.
The SigEvent class, used for AIO notifications among other things, is
also added.
Also, impl AsRef for TimeVal and TimeSpec
|