summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-02Merge #1227 #1228bors[bot]
1227: Test on Rust stable again r=asomers a=asomers This commit reverts eba3b516f7f76465e2fbe1c16724786144f01e8e, which worked around a Travis CI bug that has since been fixed. The effect is to resume testing on the latest Rust stable. 1228: Fix an "unused macro" warning on non-Linux platforms r=asomers a=asomers cc @glebpom Co-authored-by: Alan Somers <asomers@gmail.com>
2020-05-02Fix an "unused macro" warning on non-Linux platformsAlan Somers
2020-05-02Test on Rust stable againAlan Somers
This commit reverts eba3b516f7f76465e2fbe1c16724786144f01e8e, which worked around a Travis CI bug that has since been fixed. The effect is to resume testing on the latest Rust stable.
2020-05-01Merge #1215bors[bot]
1215: Remove sys::socket::addr::from_libc_sockaddr from the public API r=posborne a=asomers This function never should've been public, since it's basically impossible to use directly. It's only public due to an oversight from PR #667 . Co-authored-by: Alan Somers <asomers@gmail.com>
2020-04-26Merge #1208bors[bot]
1208: Support sendmmsg/recvmmsg r=asomers a=glebpom This pull request adds `sendmmsg` and `recvmmsg` functions. They are used to send and receive multiple messages per one call. Additionally, `AsMut` implemented for both `TimeSpec` and `TimeVal`. This is still WIP, because we need to find the best way on how to pass multiple values to *mmsg functions. Current approach with iterators doesn't seem ergonomic. Co-authored-by: Gleb Pomykalov <gleb@lancastr.com> Co-authored-by: Alan Somers <asomers@gmail.com>
2020-04-26Eliminate a mem::zeroed() in recvmmsgAlan Somers
2020-04-26Support sendmmsg/recvmmsgGleb Pomykalov
2020-04-25Merge #1209bors[bot]
1209: Support UDP GSO and GRO on linux r=asomers a=glebpom This PR implements support for UDP GSO and GRO on Linux. It provides the way to send/receive UDP payloads bigger than interface MTU. The goal is to improve UDP performance. GSO was introduced in Linux 4.18, GRO in 5.3 Co-authored-by: Gleb Pomykalov <gleb@lancastr.com>
2020-04-25Merge #1221bors[bot]
1221: Fix compilation on DragonFly (statfs) r=asomers a=mneumann Co-authored-by: Michael Neumann <mneumann@ntecs.de>
2020-04-25Support UDP GSO and GRO on linuxGleb Pomykalov
2020-04-25Merge #1220bors[bot]
1220: Fix RISC-V support r=asomers a=andreas-schwab Don't try to use PTRACE_[GS]ETREGS, PTRACE_[GS]ETFPREGS or PTRACE_[GS]ETFPXREGS on riscv64, they are legacy-only. Co-authored-by: Andreas Schwab <schwab@suse.de>
2020-04-25Fix compilation on DragonFly (statfs)Michael Neumann
2020-04-25Fix RISC-V supportAndreas Schwab
Don't try to use PTRACE_[GS]ETREGS, PTRACE_[GS]ETFPREGS or PTRACE_[GS]ETFPXREGS on riscv64, they are legacy-only.
2020-04-24Merge #1210bors[bot]
1210: impl io::{Read,Write} for PtyMaster r=asomers a=cuviper `PtyMaster` acts like an owned file descriptor, even closing on `Drop`. Implementing `io::Read` and `io::Write` lets it be used directly in standard I/O operations. Co-authored-by: Josh Stone <jistone@redhat.com>
2020-04-22Merge #1211bors[bot]
1211: Feature/hugepage size r=asomers a=GuillaumeDIDIER Should solve #1194 . Co-authored-by: GuillaumeDIDIER <guillaume.didier95@hotmail.fr>
2020-04-21impl io::{Read,Write} for PtyMasterJosh Stone
`PtyMaster` acts like an owned file descriptor, even closing on `Drop`. Implementing `io::Read` and `io::Write` lets it be used directly in standard I/O operations.
2020-04-21Add the MAP_HUGE_<SIZE> flags for linux.GuillaumeDIDIER
Closes #1194 Use git libc for development (Remember to reset this to released version for the next nix release, once libc has released >=0.2.69)
2020-04-19Merge #1217 #1218bors[bot]
1217: Remove a few more cases of mem::uninitialized in the tests r=asomers a=asomers Somehow I didn't noticed these in PR #1158, probably because they're only built on Linux. 1218: Update the FreeBSD CI image to 11.3. r=asomers a=asomers 11.2 is EOL. Co-authored-by: Alan Somers <asomers@gmail.com>
2020-04-19Update the FreeBSD CI image to an 11.3 snapshotAlan Somers
11.2 is EOL.
2020-04-19Merge #1207bors[bot]
1207: Add select::FdSet::fds() method r=asomers a=zombiezen To be more consistent with most Rust APIs and enable cloning of the iterator, I made `FdSet::contains` operate on an immutable borrow instead of a mutable one by copying the set. If this is not desirable, I can roll that back from this PR and focus purely on the `fds()` method. Co-authored-by: Ross Light <ross@zombiezen.com>
2020-04-19Remove a few more cases of mem::uninitialized in the testsAlan Somers
Somehow I didn't noticed these in PR #1158, probably because they're only built on Linux.
2020-04-19Merge #1206bors[bot]
1206: Fix unaligned casting of cmsg data to af_alg_iv r=asomers a=glebpom Casting a pointer to `cmsg_data` to `af_alg_iv` is incorrect since it's not properly aligned. As of the [`cmsg` man page](http://man7.org/linux/man-pages/man3/cmsg.3.html) "Applications should not cast it to a pointer type matching the payload, but should instead use memcpy(3) to copy data to or from a suitably declared object." Co-authored-by: Gleb Pomykalov <gleb@lancastr.com>
2020-04-14Remove stray # in CHANGELOGRoss Light
2020-04-14Added fds testRoss Light
2020-04-14Add space to doc comment of fdsRoss Light
2020-04-14Add PR reference to CHANGELOGRoss Light
2020-04-13Remove immutable borrow note from CHANGELOGRoss Light
2020-04-13Operate on &mutRoss Light
2020-04-13Merge #1214bors[bot]
1214: Fix UB in getsockopt r=asomers a=asomers The old code tried to zero-initialize an enum for which 0 is not a valid value. That worked for older compilers, but triggers a panic with Rust 1.44.0. The correct technique is to use mem::MaybeUninit. Fixes #1212 Co-authored-by: Alan Somers <asomers@gmail.com>
2020-04-12Remove sys::socket::addr::from_libc_sockaddr from the public APIAlan Somers
This function never should've been public, since it's basically impossible to use directly. It's only public due to an oversight from PR #667 .
2020-04-12Fix UB in getsockoptAlan Somers
The old code tried to zero-initialize an enum for which 0 is not a valid value. That worked for older compilers, but triggers a panic with Rust 1.44.0. The correct technique is to use mem::MaybeUninit. Fixes #1212
2020-04-11Remove unnecessary fn main wrapper in exampleRoss Light
2020-04-08Fix unaligned castting of cmsg data to af_alg_ivGleb Pomykalov
2020-04-08Merge #1195bors[bot]
1195: Implement open file descriptor locks in fcntl r=asomers a=andrenth Hello This PR updates libc to 0.2.68, which adds the `F_OFD_*` fcntl commands, and uses them in `nix::fcntl::fcntl`. Co-authored-by: Andre Nathan <andre@digirati.com.br>
2020-04-07Add select::FdSet::fds() methodRoss Light
2020-04-06Merge #1205bors[bot]
1205: unistd: avoid infinite loop caused by reserve_double_buffer_size r=asomers a=stevendanna Functions such as Group::from_anything use reserve_double_buffer_size in a loop, expecting it to return ERANGE if the passed limit is reached. However, the returned vector is passed as pointer to a libc function that writes data into memory and doesn't update the length of the Vec. Because of this, the previous code would never return ERANGE and the calling loops would never exit if they hit a case where the required buffer was larger than the maximum buffer. This fixes the problem by checking the capacity rather than the length. Signed-off-by: Steven Danna <steve@chef.io> Co-authored-by: Steven Danna <steve@chef.io>
2020-04-06unistd: avoid infinite loop caused by reserve_double_buffer_sizeSteven Danna
Functions such as Group::from_anything use reserve_double_buffer_size in a loop, expecting it to return ERANGE if the passed limit is reached. However, the returned vector is passed as pointer to a libc function that writes data into memory and doesn't update the length of the Vec. Because of this, the previous code would never return ERANGE and the calling loops would never exit if they hit a case where the required buffer was larger than the maximum buffer. This fixes the problem by checking the capacity rather than the length. Signed-off-by: Steven Danna <steve@chef.io>
2020-04-01Merge #1198bors[bot]
1198: Enable getregs/setregs on x86_64 musl r=asomers a=coord-e Hi, I needed `ptrace::getregs` in my project. I noticed that they're only enabled on glibc while they can be compiled with musl. This PR enables getregs/setregs on x86_64 musl libc environment. Co-authored-by: coord.e <me@coord-e.com>
2020-04-02Enable getregs/setregs on muslcoord.e
Update CHANGELOG for #1198
2020-04-01Split read and write OFD lock testsAndre Nathan
2020-03-28Merge #1201bors[bot]
1201: Fix fallocate signature r=asomers a=DianaNites Fixes #1200 Co-authored-by: Diana <5275194+DianaNites@users.noreply.github.com>
2020-03-28Fix fallocate return typeDiana
Untested, done on github. Fixes #1200
2020-03-27i686 -> x86Andre Nathan
2020-03-27Explain why OFD tests are disabled in some archsAndre Nathan
2020-03-27Undo rustfmt reformatingAndre Nathan
2020-03-19One more arch exclusionAndre Nathan
2020-03-19Exclude targets failing on CIAndre Nathan
2020-03-18Don't test on mips; replace unwrap for expectAndre Nathan
2020-03-18Fix type of pad fieldAndre Nathan
2020-03-18Add missing libc::flock fields in mipsAndre Nathan