summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-15Port statfs to x32наб
2021-02-15Port timespec to x32наб
2021-02-15Port sysinfo to x32наб
2021-02-15Port mqueue to x32наб
Test fix obtained from https://github.com/nix-rust/nix/issues/1384#issuecomment-774708486
2021-02-15Merge #1333bors[bot]
1333: Dir: Implement `IntoIterator` for `Dir` r=asomers a=wmanley This is useful to allow returning an iterator based on a directory iterator without needing a self-referential struct. Co-authored-by: William Manley <will@stb-tester.com>
2021-02-15Dir: Implement `IntoIterator` for `Dir`William Manley
This is useful to allow returning an iterator based on a directory iterator without needing a self-referential struct.
2021-02-15Merge #1387bors[bot]
1387: fix(unsafe): remove unnecessary unsafe r=asomers a=matu3ba libc 0.2.82 exposes status signals with macros generating safe functions Co-authored-by: Jan Philipp Hafer <jan.hafer@rwth-aachen.de>
2021-02-14fix(unsafe): remove unnecessary unsafeJan Philipp Hafer
closes #1380 libc 0.2.82 exposes status signals with macros generating safe functions
2021-02-14cargo formatJan Philipp Hafer
2021-02-13Merge #1382bors[bot]
1382: Don't implement Clone on Dir, SignalFd, and PtyMaster r=asomers a=asomers Since they close their file descriptors on Drop, it's almost impossible to use Clone without creating a double-close situation. Also, check for EBADF in SignalFd::drop and Dir::drop. Co-authored-by: Alan Somers <asomers@gmail.com>
2021-02-07Don't implement Clone on Dir, SignalFd, and PtyMasterAlan Somers
Since they close their file descriptors on Drop, it's almost impossible to use Clone without creating a double-close situation. Also, check for EBADF in SignalFd::drop and Dir::drop.
2021-02-07Merge #1338bors[bot]
1338: Add a passwd field to Group r=asomers a=blinsay Adds a `passwd` field to unistd::Group. The `gr_passwd` field exists on `libc::group` and wasn't exposed. I didn't see tests for `from(libc:group)` for either `User` or `Password`. Let me know if there are other tests I should add! Co-authored-by: Ben Linsay <blinsay@gmail.com>
2021-02-07add passwords to GroupsBen Linsay
2021-02-07Merge #1372bors[bot]
1372: Remove s390x exemptions from sys::statfs MAGIC constants r=asomers a=Jakob-Naucke Since rust-lang/libc is now using the correct data type on s390x (c_uint) for statfs constants, the s390x exemptions in the statfs MAGIC definitions like EXT4_SUPER_MAGIC can be removed. Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com> Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-02-02Define *_MAGIC filesystem constants on Linux s390xJakob Naucke
Since rust-lang/libc is now using the correct data type on s390x (c_uint) for statfs constants, the s390x exemptions in the statfs MAGIC definitions like EXT4_SUPER_MAGIC can be removed. Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-01-31Merge #1344bors[bot]
1344: Add support for `SockAddr::Link` when receiving packets r=asomers a=internetionals fixes #1343 Co-authored-by: Justin Ossevoort <github@internetionals.nl>
2021-01-04Add support for when receiving packetsJustin Ossevoort
2021-01-03Merge #1368bors[bot]
1368: Fix fcntl for FreeBSD platform r=asomers a=AlexanderThaller When compiling the following code with nix `0.19.1` under FreeBSD 12.2: ``` use std::os::unix::io::AsRawFd; fn main() { let f = std::fs::File::create("/tmp/testfile").unwrap(); nix::fcntl::posix_fadvise( f.as_raw_fd(), 0, 0, nix::fcntl::PosixFadviseAdvice::POSIX_FADV_NOREUSE, ).unwrap(); } ``` I get the following error: ``` error[E0433]: failed to resolve: could not find `PosixFadviseAdvice` in `fcntl` --> src/main.rs:10:21 | 10 | nix::fcntl::PosixFadviseAdvice::POSIX_FADV_NOREUSE, | ^^^^^^^^^^^^^^^^^^ could not find `PosixFadviseAdvice` in `fcntl` error[E0425]: cannot find function `posix_fadvise` in module `nix::fcntl` --> src/main.rs:6:17 | 6 | nix::fcntl::posix_fadvise( | ^^^^^^^^^^^^^ not found in `nix::fcntl` error: aborting due to 2 previous errors ``` Checking the documentation I noticed the documentation for the FreeBSD platform was missing: https://docs.rs/nix/0.19.1/x86_64-unknown-freebsd/nix/?search=PosixFadviseAdvice Checking the code I noticed that `target_env` was used instead of `target_os`: * https://doc.rust-lang.org/reference/conditional-compilation.html#target_env * https://doc.rust-lang.org/reference/conditional-compilation.html#target_os Switching to `target_os` fixed the compilation errors. I also ran the tests with the fix and they seemed to be fine: ``` test result: ok. 68 passed; 0 failed; 14 ignored; 0 measured; 0 filtered out ``` I hope this makes sense to fix. Co-authored-by: Alexander Thaller <alexander.thaller@trivago.com>
2021-01-03Fix fcntl for FreeBSDAlexander Thaller
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.
2020-12-22Merge #1342bors[bot]
1342: feat(unistd): Add getpeereid(3) r=asomers a=woodruffw `getpeereid(3)` is not POSIX, but it's present on many BSD-derived Unices. It's also the standard mechanism on those OSes for retrieving socket peer credentials (compare `getsockopt` + `SO_PEERCRED` on Linux, which `nix` already supports). Closes #1339. Co-authored-by: William Woodruff <william@yossarian.net>
2020-12-19unistd: Add getpeereid(3)William Woodruff
Closes #1339.
2020-12-19Merge #1285bors[bot]
1285: Add fuchsia support r=asomers a=amanda-tait This change adds support for the Fuchsia operating system to the nix crate. Fuchsia developers have a use case for nix, particularly its safe interfaces to the recvmsg(2) and sendmsg(2). Adding support requires: * incrementing the libc dependency to 0.2.74 * conditionally not compiling nix functionality which depends on libc functionality that does not exist for Fuchsia Co-authored-by: Tamir Duberstein <tamird@google.com> Co-authored-by: Amanda Tait <atait@google.com>
2020-12-19Add fuchsia supportAmanda Tait
Allow nix to compile on Fuchsia by conditionally avoiding libc functionality that does not exist for Fuchsia.
2020-12-19Update cross-compilation Rust version to 1.40.0Tamir Duberstein
This was missed in d36353701341df9cfffb4fc4e88c002698d2deda.
2020-12-19Merge #1331bors[bot]
1331: feat(sys): High-level personality(2) wrappers r=asomers a=woodruffw Adds a high level `Persona` bitflags enum, as well as `personality::get()` and `personality::set()` for interacting with `libc::personality()`. Closes #1330. See also https://github.com/rust-lang/libc/pull/1974. Co-authored-by: William Woodruff <william@trailofbits.com>
2020-12-18Merge #1365bors[bot]
1365: Fix duplicate entry in bors.toml r=asomers a=asomers Also, sort the entries alphabetically, since that's how Github displays them. Co-authored-by: Alan Somers <asomers@gmail.com>
2020-12-18Fix duplicate entry in bors.tomlAlan Somers
Also, sort the entries alphabetically, since that's how Github displays them.
2020-12-15feat(sys): High-level personality(2) wrappersWilliam Woodruff
Adds a high level `Persona` bitflags enum, as well as `personality::get()` and `personality::set()` for interacting with `libc::personality()`.
2020-12-14Merge pull request #1362 from asomers/no_socklevelAlan Somers
Remove SockLevel
2020-12-14Remove SockLevelAlan Somers
It's been unused since PR #133
2020-12-14Merge pull request #1358 from asomers/rust_1.40.0Alan Somers
Raise MSRV to 1.40.0
2020-12-14Ignore failures of test_aio_suspend on macosAlan Somers
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
2020-12-10Remove a workaround for an old Musl bugAlan Somers
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
2020-12-10Merge pull request #1359 from asomers/no_travis_badgeAlan Somers
[skip ci] Update docs and build badges for the Travis -> Cirrus move
2020-12-10[skip ci] Update docs and build badges for the Travis -> Cirrus moveAlan Somers
2020-12-10Raise MSRV to 1.40.0Alan Somers
This will shortly be needed for Fuchsia support.
2020-12-09Merge pull request #1355 from asomers/alarm_doc_testAlan Somers
Fix intermittency in the doc test for alarm
2020-12-09Fix intermittency in the doc test for alarmAlan Somers
On Cirrus CI, this test would sometimes fail, probably due to pause being awoken by SIGRT_1. sigwait is a superior alternative to pause. Fixes #1354
2020-12-09Merge pull request #1353 from asomers/test_reliability2Alan Somers
Fix intermittency in some tests
2020-12-09Ignore the execve tests on muslAlan Somers
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
2020-12-08Fix unreliability in sys::test_aio::test_aio_suspendAlan Somers
On OSX, this test has begun to fail in CI on OSX. Presumably it's because aio_suspend was getting interrupted by a signal.
2020-12-08Fix a race in the test_unistd::test_fchown testAlan Somers
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.
2020-12-07Merge pull request #1350 from asomers/cirrus4allAlan Somers
Switch all builds from Travis to Cirrus
2020-12-07Fix a use-after-free in execve_test_factoryAlan Somers
Ensure that the exec functions' arguments are valid for 'static. Previously they were short-lived temporaries.
2020-12-06Switch all builds from Travis to CirrusAlan Somers
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
2020-12-06Handle SIGRT_1 in test_alarmAlan Somers
When run in Cirrus-CI's environment, the tests generate copious SIGRT_1 signals. This commit ensures that test_alarm will ignore them.
2020-12-06Make the poll tests resilient against signalsAlan Somers
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.
2020-12-06Disable clock_getres on redoxNoah
2020-12-06Demote i686-apple-darwin to Tier 2Alan Somers
It's deprecated by Xcode, and the version of Xcode installed by Cirrus-CI doesn't include 32 bit libraries.
2020-11-28[skip ci] Add v0.19.1 release notes to CHANGELOGAlan Somers