summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-09-19Require CAP_SYS_PTRACE for certain testsAlan Somers
process_vm_readv requires it, and I'm not exactly sure which other things do too.
2019-09-04Merge #1120bors[bot]
1120: Fix length of abstract socket address r=asomers a=yshui NULL bytes have no special significance in an abstrace address, and the length of the address is solely decided by the length member. If the length is set to sun_path.len(), all the NULL bytes will be considered part of the address. Tests are updated accordingly. Closes #1119 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-04Fix length of abstract socket addressYuxuan Shui
NULL bytes have no special significance in an abstrace address, and the length of the address is solely decided by the length member. If the length is set to sun_path.len(), all the NULL bytes will be considered part of the address. Tests are updated accordingly. Closes #1119 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-09-04Merge #1113bors[bot]
1113: Libc enum tryfrom r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2019-09-04Replace Signal::from_c_int by Signal::try_fromAlan Somers
TryFrom wasn't stable when that function was written.
2019-09-04Simplify implementation of libc_enum! with vis metavariablesAlan Somers
2019-09-04Merge #1114bors[bot]
1114: Replace most instances of mem::uninitialized with mem::MaybeUninit r=asomers a=asomers Only two instances remain: * For the deprecated sys::socket::CmsgSpace::new. We should probably just remove that method. * For sys::termios::Termios::default_uninit. This will require some more thought. Co-authored-by: Alan Somers <asomers@gmail.com>
2019-09-03Skip the aio_suspend test on LinuxAlan Somers
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
2019-09-03Workaround an outdated Travis imageAlan Somers
Travis's "stable" images are stuck on Rust 1.35.0
2019-09-03Replace most instances of mem::uninitialized with mem::MaybeUninitAlan Somers
Only two instances remain: * For the deprecated sys::socket::CmsgSpace::new. We should probably just remove that method. * For sys::termios::Termios::default_uninit. This will require some more thought. Fixes #1096
2019-08-30Merge #1107bors[bot]
1107: Clippy cleanup r=asomers a=asomers This is preparation for several changes relating to raising the MSRV, most importantly eliminating `mem::uninitialized`. Co-authored-by: Alan Somers <asomers@gmail.com>
2019-08-29Clippy: remove an unused lifetime parameterAlan Somers
2019-08-29Implement Default for FdSetAlan Somers
2019-08-29Remove an obsolete commentAlan Somers
It was leftover from internal churn during PR #1020.
2019-08-29Clippy: silence a false-positive cast alignment warningAlan Somers
2019-08-29Clippy: remove unnecessary mem::transmuteAlan Somers
2019-08-29Clippy cleanupAlan Somers
2019-08-29Merge #1108bors[bot]
1108: Raise minimum supported Rust version to 1.36.0 r=asomers a=otavio Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Co-authored-by: Otavio Salvador <otavio@ossystems.com.br> Co-authored-by: Alan Somers <asomers@gmail.com>
2019-08-28Fix some ioctl tests on muslAlan Somers
Weirdly, musl uses i32 to store the ioctl opcode
2019-08-28Raise minimum supported Rust version to 1.36.0Otavio Salvador
The minimum supported Rust version is being raised to 1.36.0 as this is the first release to support the `mem::MaybeUninit` feature. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-08-22Merge #1109bors[bot]
1109: fix readlink/readlinkat to return too long only when it is long r=asomers a=sendilkumarn Currently readlink returns `ENAMETOOLONG` when the bufferSize is equal to the result size. Consider the below case ```c++ int main(int argc, const char * argv[]) { std::string filename = "/tmp/test-dir/target"; size_t bufferSize = 9; char* buffer = new char[bufferSize]; size_t rc = readlink (filename.c_str(), buffer, bufferSize); // Since `readlink's` output depends on the `bufferSize`. If the`bufferSize` is 9 or greater than // 9 then it will return 9 or else it will return `bufferSize` as the value of `rc`. return 0; } ``` Co-authored-by: Sendil Kumar <sendilkumarn@live.com> Co-authored-by: Sendil Kumar N <sendilkumarn@live.com>
2019-08-22Update CHANGELOG.mdSendil Kumar N
2019-08-22updated changelogSendil Kumar
2019-08-22remove macro symbolSendil Kumar
2019-08-22add readlinkat tooSendil Kumar
2019-08-22fix review commentsSendil Kumar
2019-08-22Add changelogSendil Kumar
2019-08-22update readlink to return the path instead of mangling the bufferSendil Kumar
2019-08-22fix readlink/readlinkat to return too long only when it is longSendil Kumar
2019-08-10Merge #1104bors[bot]
1104: Release v0.15.0 r=asomers a=asomers It's important to release fairly soon, because rustc 1.38.0 will deprecate std::mem::uninitialized. Co-authored-by: Alan Somers <asomers@gmail.com>
2019-08-10Release v0.15.0Alan Somers
2019-07-18Merge #1097bors[bot]
1097: Add renameat, AT_FDCWD r=asomers a=scottlamb Co-authored-by: Scott Lamb <slamb@slamb.org>
2019-07-17Add renameatScott Lamb
renameat is (somewhat oddly, imho) in stdio.h. I put it in nix::fcntl because there's no nix::stdio and all its friends (including the AT_* constants) are in nix::fcntl.
2019-07-16Merge #1058bors[bot]
1058: Implement unlinkat r=asomers a=jlb6740 This adds the unlinkat function, which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html and widely implmented on Unix-family platforms. Co-authored-by: Johnnie Birch <45402135+jlb6740@users.noreply.github.com>
2019-07-14Implement unlinkatJohnnie Birch
This adds the unlinkat function, which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html and widely implmented on Unix-family platforms. Implement unlinkat - Update comments to unlink at and breakup tests Changes made based on comments from pull request #1058 Implement unlinkat - Update should_panic for more precise check Updae should_panic attribute for more precise check. Also remove some dead code and note the pull request ID. Implement unlinkat - Update error handling to use unwrap_err The previous patch failed testing on two targets that returned EPERM as the Sys error instead of EISDIR. This patch changes from using the should_panic attribute to using the unwrap_err and matching against the result. Implement Unlinkat - Passing tests should not print anything. Fix. Implement unlinkat - Update location of commit comment in the CHANGELOG Implement unlinkat - Remove newline
2019-07-13Merge #1095bors[bot]
1095: Fix warnings on Rust 1.37.0 r=asomers a=asomers * Replace obsolete range syntax "..." with inclusive range "..=" * Use dyn Trait syntax instead of Box<Trait> * Raise MSRV to 1.27.0 (for dyn Trait syntax) * Test with nightly again Co-authored-by: Alan Somers <asomers@gmail.com>
2019-07-13Temporarily allow deprecated itemsAlan Somers
This fixes the tests on Rust 1.38.0. We'll fix them for real after release 0.15.0. Issue #1096
2019-07-13Do "cargo check" instead of "cargo build" for the MSRV checkAlan Somers
check is faster than build.
2019-07-13Fix warnings on Rust 1.37.0Alan Somers
* Replace obsolete range syntax "..." with inclusive range "..=" * Use dyn Trait syntax instead of Box<Trait> * Raise MSRV to 1.27.0 (for dyn Trait syntax) * Raise MSRV to 1.31.0 (because of rand) tempfile pulls in rand, and rand pulls in fuchsia-cprng, which requires 1.31.0. Why rand pulls in fuchsia-cprng I don't know. It's specified as a target-specific dependency, but Cargo tries to build it anyway (only on Linux, not on FreeBSD or OSX). A bug in Cargo 1.27.0?
2019-07-12Merge #1091bors[bot]
1091: socket: add support for AF_VSOCK r=asomers a=stefano-garzarella This patch adds the support of AF_VSOCK in the socket module. VSOCK is present since Linux 3.9. Co-authored-by: Stefano Garzarella <sgarzare@redhat.com>
2019-07-12test_socket: add AddressFamily::Vsock testStefano Garzarella
The current VSOCK implementation does not support loopback devices, so, for now, we expect a failure in the spawned thread when it tries to connect. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2019-07-12socket: add support for AF_VSOCKStefano Garzarella
This patch adds AF_VSOCK support to AddressFamily in order to use VSOCK socket. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2019-07-11Merge #1089bors[bot]
1089: implement posix_fadvise r=asomers a=kevinwern See: https://github.com/CraneStation/wasi-common/issues/16 http://man7.org/linux/man-pages/man2/posix_fadvise.2.html Conditional compilation derived from corresponding libc conditions: Fuchsia: https://github.com/rust-lang/libc/blob/0b02c4060a750983cebcccdf1f35a5ec4cdcf516/src/fuchsia/mod.rs#L3807 https://github.com/rust-lang/libc/blob/0e702c1b4e2e56788e8b67d3efd9c242807c3d4b/src/lib.rs#L104-L109 uClibc: https://github.com/rust-lang/libc/blob/11c762c535cb43dda3d9d87a0845c55201a905fb/src/unix/uclibc/mod.rs#L1676 https://github.com/rust-lang/libc/blob/ce7e3a7e866dd7109a971b694a2bf58bd08f101a/src/unix/mod.rs#L1141-L1143 https://github.com/rust-lang/libc/blob/0e702c1b4e2e56788e8b67d3efd9c242807c3d4b/src/lib.rs#L116-L121 Linux, android, emscripten: https://github.com/rust-lang/libc/blob/11c762c535cb43dda3d9d87a0845c55201a905fb/src/unix/linux_like/mod.rs#L1303 https://github.com/rust-lang/libc/blob/ce7e3a7e866dd7109a971b694a2bf58bd08f101a/src/unix/mod.rs#L1147-L1151 https://github.com/rust-lang/libc/blob/0e702c1b4e2e56788e8b67d3efd9c242807c3d4b/src/lib.rs#L116-L121 FreeBSD: https://github.com/rust-lang/libc/blob/e0ff1e68b9e34173e9c4c3217d1b0fc81a7d352d/src/unix/bsd/freebsdlike/freebsd/mod.rs#L1223 https://github.com/rust-lang/libc/blob/ce7e3a7e866dd7109a971b694a2bf58bd08f101a/src/unix/bsd/freebsdlike/mod.rs#L1307-L1309 https://github.com/rust-lang/libc/blob/ce7e3a7e866dd7109a971b694a2bf58bd08f101a/src/unix/bsd/mod.rs#L683-L685 https://github.com/rust-lang/libc/blob/ce7e3a7e866dd7109a971b694a2bf58bd08f101a/src/unix/mod.rs#L1152-L1159 https://github.com/rust-lang/libc/blob/0e702c1b4e2e56788e8b67d3efd9c242807c3d4b/src/lib.rs#L116-L121 WASI: https://github.com/rust-lang/libc/blob/0e702c1b4e2e56788e8b67d3efd9c242807c3d4b/src/wasi.rs#L1001 https://github.com/rust-lang/libc/blob/0e702c1b4e2e56788e8b67d3efd9c242807c3d4b/src/lib.rs#L134-L139 Co-authored-by: Kevin Wern <kevin.m.wern@gmail.com>
2019-07-09Merge #1085bors[bot]
1085: Minimal versions r=asomers a=asomers Build test with -Zminimal-versions in CI. Co-authored-by: Alan Somers <asomers@gmail.com>
2019-07-09implement posix_fadviseKevin Wern
2019-07-03Merge #1090bors[bot]
1090: Expose sched_yield on non-linux-like hosts r=asomers a=kubkon Currently, `sched` module is compiled only for linux-like hosts. However, the recently added syscall `sched_yield` is universal to all *nixes. This PR pulls all linux-like functionality into a private `sched_linux_like` module which is enabled only for android and linux hosts, while `sched_yield` and `sched` modules are now compiled for all *nixes, thus, correctly exposing `sched_yield` to other non-linux hosts. Co-authored-by: Jakub Konka <jakub.konka@golem.network>
2019-07-01Document changes in CHANGELOGJakub Konka
2019-07-01Enable sched_yield for all *nix hostsJakub Konka
2019-07-01Move cross compilation cfg for sched into sched modJakub Konka
2019-07-01Merge #1094bors[bot]
1094: Restrict tempfile to < 3.0.9 r=asomers a=asomers tempfile release 3.0.9 raised the MSRV without a minor version bump. See https://github.com/Stebalien/tempfile/issues/100 Co-authored-by: Alan Somers <asomers@gmail.com>