summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-30Merge #1439bors[bot]
1439: Add sendfile64 r=asomers a=tdryer `sendfile64` is a Linux-specific call with a wider type for the `offset` argument than `sendfile`. This is largely a copy of the existing `sendfile` function and associated test. Co-authored-by: Tom Dryer <tomdryer.com@gmail.com>
2021-05-30Merge #1438bors[bot]
1438: Update to semver 1.0.0 r=asomers a=dtolnay Co-authored-by: David Tolnay <dtolnay@gmail.com>
2021-05-28Add pull request link to changelogTom Dryer
2021-05-28Disable sendfile64 on androidTom Dryer
It's not available from libc on that platform.
2021-05-28Add sendfile64Tom Dryer
`sendfile64` is a Linux-specific call with a wider type for the `offset` argument than `sendfile`. This is largely a copy of the existing `sendfile` function and associated test.
2021-05-27Update to semver 1.0.0David Tolnay
2021-05-23Merge #1433bors[bot]
1433: Use fstatat to check long path sizes in fcntl::readlinkat r=asomers a=zxzax Without this, the `lstat` call ignores the `dirfd` and checks the wrong file. I wanted to write a unit test for this but I'm not sure how to do it reliably, AFAIK the maximum path size can vary between filesystems. Co-authored-by: Jason Francis <zxzax@protonmail.com>
2021-05-23Use fstatat to check long path sizes in fcntl::readlinkatJason Francis
2021-05-23Merge pull request #1436 from nix-rust/rustup-hangAlan Somers
Workaround Rustup bug 2774
2021-05-23Workaround Rustup bug 2774Alan Somers
A regression in rustup has broken that tool on FreeBSD. Set RUSTUP_IO_THREADS=1 as a workaround. https://github.com/rust-lang/rustup/issues/2774
2021-05-16Merge #1434bors[bot]
1434: Rewrite links to use https:// instead of http:// r=asomers a=rtzoeller All of the `http://` links in the repository are also available as `https://, and have been updated. The sole exception to this trivially rewrite is a dead-link to `http://rust-lang.org/COPYRIGHT`, which has been replaced with `https://www.rust-lang.org/policies/licenses`. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2021-05-13Use https instead of httpRyan Zoeller
2021-05-01Merge pull request #1431 from asomers/alarm_doc_test2Alan Somers
Hopefully improve unistd::alarm::set's doc test's reliability
2021-05-01Hopefully improve unistd::alarm::set's doc test's reliabilityAlan Somers
2021-05-01Merge #1429bors[bot]
1429: constify from_raw and as_raw for Uid, Gid and Pid and Uid::is_root r=asomers a=Blub Make some integer wrapper methods `const fn`. * `Uid::from_raw` * `Uid::as_raw` * `Uid::is_root` * `Gid::from_raw` * `Gid::as_raw` * `Pid::from_raw` * `Pid::as_raw` (Changelog mentions rust 1.40.0 as minimum required version which seems to compile this fine (using 1.40.0 from rustup)) Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-26constify from_raw and as_raw for Uid, Gid and PidWolfgang Bumiller
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-04-23Merge #1427bors[bot]
1427: Fix timestamp doc r=asomers a=WiSaGaN This fixed doc test issue here: https://docs.rs/nix/0.20.0/nix/sys/socket/enum.ControlMessageOwned.html#variant.ScmTimestamp Co-authored-by: Lu, Wangshan <wisagan@gmail.com>
2021-04-19Fix timestamp docLu, Wangshan
2021-04-08Merge #1402bors[bot]
1402: Support TIMESTAMPNS r=asomers a=WiSaGaN This adds support of linux TIMESTAMPNS. The code is mostly copied paste from https://github.com/nix-rust/nix/pull/663 Co-authored-by: Lu, Wangshan <wisagan@gmail.com>
2021-04-08Merge #1414bors[bot]
1414: Fix corrupted sendmmsg() call r=asomers a=eaufavor Before this fix, the buffer that holds cmsgs may move due to the resize() call. That causes msg_hdr pointing to invalid memory, which ends up breaking the sendmmsg() call, resulting in EINVAL. This change fixes it by avoiding re-allocating the buffers. Co-authored-by: Yuchen Wu <yuchen@cloudflare.com>
2021-04-08Support TIMESTAMPNS for linuxLu, Wangshan
2021-04-07Fix spurious errors using `sendmmsg` with multiple cmsgsYuchen Wu
Before this fix, the buffer that holds cmsgs may move due to the resize() call. That causes msg_hdr pointing to invalid memory, which ends up breaking the sendmmsg() call, resulting in EINVAL. This change fixes it by avoiding re-allocating the buffers.
2021-04-05Merge #1417bors[bot]
1417: Check tests r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2021-04-04Check all tests in CIAlan Somers
Travis didn't compile check tests on platforms that couldn't run tests in CI, so they bitrotted. Let's see how bad they are. Most annoyingly, 32-bit Android defines mode_t as 16 bits, but stat.st_mode as 32-bits.
2021-04-04Merge #1416bors[bot]
1416: Use memoffset::offset_of instead of homegrown macro r=asomers a=asomers The homegrown macro was fine in 2016, but at some point it technically became UB. The memoffset crate does the same thing, but avoids UB when using rustc 1.51.0 or later. Fixes #1415 Co-authored-by: Alan Somers <asomers@gmail.com>
2021-04-04Merge #1409bors[bot]
1409: unistd: Increase maximum passwd/group buffer to 1MB r=asomers a=geofft We have one UNIX group that contains most of our users whose size is about 20 kB, so `Group::from_name` is failing with ERANGE. The discussion on PR #864 suggests that 1 MB is a reasonable maximum - it follows what FreeBSD's libc does. (glibc appears to have no maximum on the _r function and will just double the buffer until malloc fails, but that's not particularly Rusty.) Co-authored-by: Geoffrey Thomas <geofft@twosigma.com>
2021-04-04Use memoffset::offset_of instead of homegrown macroAlan Somers
The homegrown macro was fine in 2016, but at some point it technically became UB. The memoffset crate does the same thing, but avoids UB when using rustc 1.51.0 or later. Fixes #1415
2021-03-25unistd: Increase maximum passwd/group buffer to 1MBGeoffrey Thomas
We have one UNIX group that contains most of our users whose size is about 20 kB, so `Group::from_name` is failing with ERANGE. The discussion on PR #864 suggests that 1 MB is a reasonable maximum - it follows what FreeBSD's libc does. (glibc appears to have no maximum on the _r function and will just double the buffer until malloc fails, but that's not particularly Rusty.)
2021-03-24Merge #1401bors[bot]
1401: cleanup: remove redundant unwrap in Dir::from_fd r=asomers a=scottlamb Co-authored-by: Scott Lamb <slamb@slamb.org>
2021-03-23Merge #1406bors[bot]
1406: Allow cmsg_space! to be used in unit tests r=asomers a=WiSaGaN Fixes https://github.com/nix-rust/nix/issues/1405 Co-authored-by: Lu, Wangshan <wisagan@gmail.com>
2021-03-23Merge #1407bors[bot]
1407: Fix test_vsock failure on VMADDR_CID_LOCAL testing and re-enable it r=asomers a=stefano-garzarella Starting from Linux 5.6, `VMADDR_CID_LOCAL` is supported to do local communication (loopback device). Before Linux 5.6 it was called `VMADDR_CID_RESERVED` and was not supported, so we could expect an `EADDRNOTAVAIL`, but now this address is supported and handled by the 'vsock_loopback' kernel module loaded automatically if no other vsock transports are loaded. Issue #1310 Issue #1403 Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Co-authored-by: Stefano Garzarella <sgarzare@redhat.com>
2021-03-23Allow cmsg_space! to be used in unit testsLu, Wangshan
2021-03-22Revert "Temporarily disable test_vsock on QEMU arches"Stefano Garzarella
This reverts commit c0783e7f8d55a7725179afc1b3c8eeae932d228c. Now the test should work correctly, so we can re-enable it. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2021-03-22Fix test_vsock failure on VMADDR_CID_LOCAL testingStefano Garzarella
Starting from Linux 5.6, VMADDR_CID_LOCAL is supported to do local communication (loopback device). Before Linux 5.6 it was called VMADDR_CID_RESERVED and was not supported, so we could expect an EADDRNOTAVAIL, but now this address is supported and handled by the 'vsock_loopback' kernel module loaded automatically if no other vsock transports are loaded. Issue #1310 Issue #1403 Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2021-03-21Merge #1394bors[bot]
1394: illumos and Solaris support r=asomers a=jasonbking Adds support for the illumos target as well as improvements in the existing Solaris support. Co-authored-by: Dominik Hassler <hadfl@omnios.org> Co-authored-by: Joshua M. Clulow <josh@sysmgr.org> Co-authored-by: Jason King <jason.brian.king@gmail.com>
2021-03-21cleanup: remove redundant unwrap in Dir::from_fdScott Lamb
2021-03-21illumos and Solaris supportJason King
Co-authored-by: Dominik Hassler <hadfl@omnios.org> Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
2021-03-21Merge #1404bors[bot]
1404: Temporarily disable test_vsock on QEMU arches r=asomers a=asomers Issue #1403 Co-authored-by: Alan Somers <asomers@gmail.com>
2021-03-21Temporarily disable test_vsock on QEMU archesAlan Somers
Issue #1403
2021-03-06Merge #1395bors[bot]
1395: Allow sockaddr_ll size mismatch r=asomers a=internetionals Apparently the Linux kernel can return smaller sizes when the value in the last element of sockaddr_ll (`sll_addr`) is smaller than the declared size of that field. Co-authored-by: Justin Ossevoort <github@internetionals.nl>
2021-03-05Allow sockaddr_ll size mismatchJustin Ossevoort
Apparently the Linux kernel can return smaller sizes when the value in the last element of sockaddr_ll (`sll_addr`) is smaller than the declared size of that field.
2021-03-04Merge pull request #1398 from asomers/s390x-dupAlan Somers
Remove a duplicate stanza from .cirrus.yml
2021-03-04Remove a duplicate stanza from .cirrus.ymlAlan Somers
2021-03-04Merge pull request #1399 from asomers/accept4-androidAlan Somers
Remove accept4 on Android arm
2021-03-04Remove accept4 on Android armAlan Somers
libc removed it in version 0.2.87. https://github.com/rust-lang/libc/pull/2079
2021-02-23Merge pull request #1392 from asomers/docker_builderAlan Somers
During CI, use just 1 cpu for QEMU builds
2021-02-23During CI, use just 1 cpu for QEMU buildsAlan Somers
https://github.com/cirruslabs/cirrus-ci-docs/issues/741
2021-02-21Merge #1390bors[bot]
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>
2021-02-20Merge pull request #1391 from asomers/update-depsAlan Somers
Various maintenance stuff
2021-02-20pty: Make forkpty() unsafeTavian Barnes
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.