summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2019-06-30Restrict tempfile to < 3.0.9Alan Somers
tempfile release 3.0.9 raised the MSRV without a minor version bump. See https://github.com/Stebalien/tempfile/issues/100
2019-06-20Merge #928bors[bot]
928: Wrap libc::statfs r=asomers a=alesharik Fix for [#926](https://github.com/nix-rust/nix/issues/926) Co-authored-by: alesharik <alesharikreserv@yandex.ru>
2019-06-16Merge #1084bors[bot]
1084: sys/stat: implement mkdirat r=asomers a=kevinwern See: https://github.com/CraneStation/wasi-common/issues/16 https://linux.die.net/man/2/mkdirat My first contribution to this repo. Tests were probably overkill... Also, out of curiosity, is there any reason why `mkdir` is located in `unistd`? The documentation I read mentioned the function definition also being located in `sys/stat.h`. Co-authored-by: Kevin Wern <kevin.m.wern@gmail.com>
2019-06-15sys/stat: implement mkdiratKevin Wern
2019-06-16Merge #1069bors[bot]
1069: Implement copy_file_range() r=asomers a=ArniDagur This should fix the problems with #971 and #1008. Co-authored-by: Árni Dagur <arnidg@protonmail.ch>
2019-06-12Update statfsalesharik
2019-06-12Test minimal-dependencies in CIAlan Somers
Test that we can build with the minimum versions of all of our declared dependencies. It's sufficient to test on one OS because none of the OSes that we test in CI has OS-dependent dependencies.
2019-06-12Implement `copy_file_range()`Árni Dagur
2019-06-12Merge #1035bors[bot]
1035: Implement extra traits for all types r=asomers a=Susurrus Now that I've gotten all the extra traits implemented for `libc`, they can be easily derived for `nix`'s types. Note that this requires a bump to the minimum supported Rust version, but it's still at least 2 versions behind, so it fits in with policy. One thing I did notice is that we have an inconsistent approach to our newtypes, where some use a struct and some a tuple struct. We should be consistent here, and should probably use a tuple struct since the name of the single field is irrelevant. This style is already suggested in our `CONVENTIONS.md` doc, so this should be uncontroversial. I'll file a PR after this is merged adding that. Co-authored-by: Bryant Mairs <bryant@mai.rs>
2019-06-11Use ptr::NonNull for DirBryant Mairs
This is a minor optimization that allows for reduced sizes of datatypes. Since this pointer will never be NULL, it's safe to use here
2019-06-11Fix tests for abstract socketsBryant Mairs
Abstract paths should always be N-1 in length where N is the length of the `sun_path` field (first byte is \0). Given that, `UnixAddr::new_abstract()` should always return this N-1 length, not just the length of the string provided (the rest of the array will be \0s).
2019-06-11Raise the cfg-if dependency to 1.0.2Alan Somers
1.0.2 adds the ability to omit the else clause, a feature we use.
2019-06-09Improve debugging of mq tests by using assert_* macrosBryant Mairs
2019-06-09Remove test of impl Debug for PollFdBryant Mairs
As this is now derived, having a test is unnecessary