Age | Commit message (Collapse) | Author |
|
Co-authored-by: Dominik Hassler <hadfl@omnios.org>
Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
|
|
Issue #1403
|
|
1390: pty: Make forkpty() unsafe r=asomers a=tavianator
After the child returns from a fork() of a multi-threaded process, it is
undefined behaviour to call non-async-signal-safe functions according to
POSIX. Since forkpty() is implemented in terms of fork(), those
restrictions should apply to it too.
Fixes #1388
Co-authored-by: Tavian Barnes <tavianator@tavianator.com>
|
|
After the child returns from a fork() of a multi-threaded process, it is
undefined behaviour to call non-async-signal-safe functions according to
POSIX. Since forkpty() is implemented in terms of fork(), those
restrictions should apply to it too.
|
|
This eliminates some duplicate dependencies
|
|
|
|
Based on
https://github.com/nix-rust/nix/issues/1384#issuecomment-774708486
|
|
Test fix obtained from
https://github.com/nix-rust/nix/issues/1384#issuecomment-774708486
|
|
This is useful to allow returning an iterator based on a directory iterator
without needing a self-referential struct.
|
|
Need to use the right cfg option for the conditional compilation.
target_os is the right option to use when targeting FreeBSD. target_env
was used before which seems to be a typo.
|
|
Closes #1339.
|
|
Allow nix to compile on Fuchsia by conditionally avoiding libc
functionality that does not exist for Fuchsia.
|
|
On Cirrus-CI, this test frequently fails with EINVAL. The error goes
away if I add a line of debugging, so it's probably a timing issue. But
I can't debug it myself.
Issue #1361
|
|
In older versions of Musl, ttyname_r would wrongly return ENOTTY instead
of EBADF. We expected that bug in our test suite. But Rust
1.37.0 updated Musl to 1.1.22, which fixes the problem. This change
reverts our workaround.
https://www.openwall.com/lists/musl/2018/09/15/2
https://github.com/rust-lang/rust/commit/aaf66987931dfe06a547b9f68cb709e9b6265b5c
|
|
On Cirrus-CI, these tests frequently segfault. It's probably indicative
of a real bug, not just a problem in the tests. But for now we need to
skip them to get CI working.
Issue #555
|
|
On OSX, this test has begun to fail in CI on OSX. Presumably it's because
aio_suspend was getting interrupted by a signal.
|
|
The test was assuming that once dropped, a temporary file's file
descriptor would be invalid. But it might not be, because another file
might be opened with the same file descriptor. Instead, use an
obviously invalid file descriptor.
|
|
Ensure that the exec functions' arguments are valid for 'static.
Previously they were short-lived temporaries.
|
|
Travis has been super-slow lately (> 6 hours per build). Cirrus is much
faster: about 20 minutes. Cirrus also has slightly better test
coverage, mainly because it doesn't use SECCOMP.
Also,
* Fix the Redox CI build. The old Travis configuration didn't actually
build for Redox, so we never noticed that Redox can't be built with a
stable compiler. Thanks to @coolreader18 for finding this.
* Disable the udp_offload tests on cross-tested platforms. These tests
are failing with ENOPROTOOPT in Cirrus-CI. I suspect it's due to a
lack of support in QEMU. These tests were skipped on Travis because
its kernel was too old.
* Fix require_kernel_version on Cirrus-CI. Cirrus reports the Linux
kernel version as 4.19.112+, which the semver crate can't handle.
* Fix test_setfsuid on Cirrus. When run on Cirrus, it seems like the
file in /tmp gets deleted as soon as it's closed. Probably an
overzealous temporary file cleaner. Use /var/tmp, because no
temporary file cleaner should run in there.
* Skip mount tests on Cirrus. They fail for an unknown reason.
Issue #1351
* Skip the AF_ALG tests on Cirrus-CI
Issue #1352
|
|
When run in Cirrus-CI's environment, the tests generate copious SIGRT_1
signals. This commit ensures that test_alarm will ignore them.
|
|
When run in Cirrus-CI's environment, the tests generate copious SIGRT_1
signals. This commit ensures that the poll tests will retry on EINTR.
|
|
1345: Disable test-aio-drop in GNU environments r=asomers a=asomers
This test occasionally fails in Travis on x86_64-unknown-linux-gnu. The
failure takes the form of the test executable receiving a random signal.
Sometimes SIGHUP, sometimes SIGKILL, etc. I think this must be a bug in
glibc, even though I can't reproduce it in my development environment.
But it interferes with CI too much to leave enabled.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
This test occasionally fails in Travis on x86_64-unknown-linux-gnu. The
failure takes the form of the test executable receiving a random signal.
Sometimes SIGHUP, sometimes SIGKILL, etc. I think this must be a bug in
glibc, even though I can't reproduce it in my development environment.
But it interferes with CI too much to leave enabled.
|
|
There were two problems discovered with the `recvmmsg(2)` implementation
that this changeset attempts to fix:
1. As mentioned in nix-rust/issues/1325, `recvmmsg(2)` can return fewer
messages than requested, and
2. Passing the return value of `recvmmsg(2)` as the number of bytes in
the messages received is incorrect.
This changeset incorporates the proposed fix from nix-rust/issues/1325,
as well as passing the correct value (`mmsghdr.msg_len`) for the number
of bytes in a given message.
|
|
test code breaks on fedora 33
```
$ cargo test
failures:
---- sys::test_socket::recvfrom::udp_offload::gro stdout ----
thread 'sys::test_socket::recvfrom::udp_offload::gro' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError("Extra junk after valid version: _64")', test/sys/test_socket.rs:292:13
```
this is due underscore in release string( arch/x86_64), which is not supported by semver.
```
$ uname -r
5.8.14-300.fc33.x86_64
```
Replace the underscore with hypen to provide a consistent sematic.
|
|
1313: Update to cfg-if 1.0 r=asomers a=mbrubeck
Co-authored-by: Matt Brubeck <mbrubeck@limpet.net>
|
|
|
|
|
|
|
|
Fix deprecation warning from libc update.
|
|
1293: Mark nix::unistd::fork as unsafe. r=asomers a=vi
Fix tests. No change in documentation.
Resolves #1030.
Don't forget to bump major version number to `0.19`.
Co-authored-by: Vitaly _Vi Shukela <vi0oss@gmail.com>
|
|
|
|
Fix tests. No change in documentation.
Resolves #1030.
|
|
1290: use subordinate terminal device for termios calls r=asomers a=jclulow
The pseudo-terminal device handling tests in some places make
tcgetattr(3C) and tcsetattr(3C) calls using the control/manager file
descriptor rather than the subordinate terminal descriptor. This works
on some systems, but not all; others such as illumos (and presumably
Solaris) are more strict and require the termios requests be made
against the terminal descriptor only.
Co-authored-by: Joshua M. Clulow <jmc@oxide.computer>
|
|
The pseudo-terminal device handling tests in some places make
tcgetattr(3C) and tcsetattr(3C) calls using the control/manager file
descriptor rather than the subordinate terminal descriptor. This works
on some systems, but not all; others such as illumos (and presumably
Solaris) are more strict and require the termios requests be made
against the terminal descriptor only.
|
|
|
|
|
|
1224: Update the Linux CI environment to Ubuntu Bionic r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
Co-authored-by: Alan Somers <asomers@axcient.com>
|
|
Removed support for timerfd on Android as it seems to have been deprecated? See https://android.googlesource.com/platform/development/+/73a5a3b/ndk/platforms/android-20/include/sys/timerfd.h or https://github.com/rust-lang/libc/issues/1589
Removed the public status of `TimerSpec`, as it should not be exposed to the user.
Implemented `FromRawFd` for `TimerFd` as it already implements `AsRawFd`.
Addressed comments from the latest code review:
- Removed upper bound assertions on timer expirations in tests.
- Made the main example runnable and added code to show how to wait for the timer.
- Refactored `ClockId` to use `libc_enum`.
- Added comments for all public parts of the module.
- Wrapped to 80 cols.
- Changed the size of the buffer in the tests to the minimum required.
* Ran rustfmt.
* Added a `From` implementation for `libc::timespec` -> `TimeSpec`.
* Reworked the example with the new changes and changed the timer from 5 to 1 second.
* Added a constructor for a 0-initialized `TimerSpec`.
* Added a new method to get the timer configured expiration (based on timerfd_gettime).
* Added an helper method to unset the expiration of the timer.
* Added a `wait` method to actually read from the timer.
* Renamed `settime` into just `set`.
* Refactored the tests and added a new one that tests both the `unset` and the `get` method.
Modified CHANGELOG.
|
|
|
|
OFD lock functions don't work as expected on overlayfs, which is a type
of union file system. And OVERLAYFS_SUPER_MAGIC isn't defined on musl,
at least not yet.
|
|
|
|
|
|
This adds Ipv4PacketInfo and Ipv6PacketInfo to ControlMessage,
allowing these to be used with sendmsg/sendmmsg.
This change contains the following squashed commits:
Add Ipv{4,6}PacketInfo to ControlMessage.
Add documentation links to Ipv{4,6}PacketInfo
Add changelog entry for Ipv{4,6}PacketInfo
Add link to PR in the Changelog.
Add extra build environments.
Add tests for Ipv{4,6}PacketInfo.
Swap #[test] and #[cfg]
The CI appears to be running the test, even though it's not cfg'd for
that platform. I _think_ this might be due to these being in the wrong
order. So lets try swapping them.
s/freebsd/netbsd/ for Ipv4PacketInfo
netbsd supports in_pktinfo, not freebsd.
Fix the cfg for Ipv{4,6}PacketInfo usage.
Ah, I see what I did wrong. I had fixed the definitions, but I had the
wrong cfg() in the usage. This has the usage match the definitions.
Change SOL_IPV6 to IPPROTO_IPV6.
FreeBSD doesn't have SOL_IPV6, but does have IPPROTO_IPV6, and the two
constants are defined as being equal. So change to use IPPROTO_IPV6.
Skip Ipv6PacketInfo test if v6 is not available.
If IPv6 is not available, then when we try and bind to ip6-localhost,
we'll get a EADDRNOTAVAIL, so skip the test.
This should mean that the test will run on any machine that has a v6
loopback address.
More architecture cfg() fixes.
These all need to be the same, and they were not. Make them them all
the same. Attempt III.
Fix up mismatched cfg's again.
Take IV. Make sure the cfg's that use a enum variant match the enum
definition.
|
|
1255: Remove several deprecated constants and functions r=asomers a=asomers
* `unistd::daemon` on Apple
* `unistd::pipe2` on Apple
* `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` on Apple
* `sys::event::FilterFlag::NOTE_REAP` on Apple
* `sys::ptrace::ptrace` on Android and Linux
All have been deprecated for more than two releases and one year.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
* `unistd::daemon` on Apple
* `unistd::pipe2` on Apple
* `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` on Apple
* `sys::event::FilterFlag::NOTE_REAP` on Apple
* `sys::ptrace::ptrace` on Android and Linux
All have been deprecated for more than two releases and one year.
|
|
|
|
This test cannot be compiled under Redox. PR #1098 attempted to disable
it for Redox, but actually disabled it everywhere. AFAICT, Cargo has no
syntax to conditionally enable a target, except based on features.
Instead, use conditional compilation within the test.
|