summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-12[skip ci] fix formatting in CHANGELOGAlan Somers
2021-06-12Merge pull request #1452 from asomers/errno-valuesAlan Somers
Fix several problems with Errno aliases
2021-06-12Add Errno::EOPNOTSUPP to FreeBSD, where it is missingAlan Somers
2021-06-12Errno aliases are now associated consts of the Errno type.Alan Somers
Previously they had to be consts in the errno module, because associated consts weren't supported until Rust 1.20.0. Now that they're associated consts, they can be used interchangeably with regular Errno enum variants.
2021-06-12Remove Errno consts from platforms where they aren't defined.Alan Somers
Previously these were aliases for UnknownErrno. Now, they're compile errors.
2021-06-12Merge pull request #1451 from asomers/warnsAlan Somers
Fix some warnings, and reenble tests that were broken on Travis
2021-06-12Reenable tests that only failed on Travis, since we no longer use it.Alan Somers
2021-06-12Fix some unused import warnings in the testsAlan Somers
2021-06-12Merge pull request #1450 from asomers/alarm-errorsAlan Somers
Hopefully fix unreliability in unistd::alarm's doc test
2021-06-12Merge pull request #1449 from asomers/aio-docsAlan Somers
Fix bad links in the aio docs
2021-06-12Hopefully fix unreliability in unistd::alarm's doc testAlan Somers
2021-06-12Fix bad links in the aio docsAlan Somers
2021-06-12Merge #1448bors[bot]
1448: Add documentation for sched::clone r=asomers a=Mandragorian Add a note in the documentation for sched::clone to point out that the stack pointer does not neet to be a reference to the highest address of the stack. Users who simply read the manpages for clone(2) might assume that they will need to use unsafe pointer arithmetics in order to create a reference to the highest address of their buffer, rather than providing their buffer directly. Co-authored-by: Konstantinos Andrikopoulos <mandragore@protonmail.com> Co-authored-by: Alan Somers <asomers@gmail.com>
2021-06-12wordsmithing on sched::cloneAlan Somers
2021-06-12Add documentation for sched::cloneKonstantinos Andrikopoulos
Add a note in the documentation for sched::clone to point out that the stack pointer does not neet to be a reference to the highest address of the stack. Users who simply read the manpages for clone(2) might assume that they will need to use unsafe pointer arithmetics in order to create a reference to the highest address of their buffer, rather than providing their buffer directly.
2021-06-06Merge #1445bors[bot]
1445: Add a wrapper around if_nameindex r=asomers a=coolreader18 Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-06-06Add a wrapper around if_nameindexNoah
2021-05-31Merge pull request #1444 from asomers/r0.21.0Alan Somers
Release v0.21.0
2021-05-31Release v0.21.0Alan Somers
2021-05-31Merge #1430bors[bot]
1430: Add getresuid() and getresgid() to unistd r=asomers a=jerylvaz Co-authored-by: Jeryl Vaz <jerylvaz@yahoo.com>
2021-05-31Add getresuid() and getresgid() to unistdJeryl Vaz
2021-05-31Merge #1443bors[bot]
1443: misc Clippy cleanup r=asomers a=asomers * Fix race conditions in the tests. Two tests were grabbing a mutex but immediately dropping it. Thank you, Clippy. * Remove vestigial Windows support. Remove some code added to support Windows in 2015. Nix is no longer intended to ever run on Windows. * Various other minor Clippy lints. Co-authored-by: Alan Somers <asomers@gmail.com>
2021-05-30misc Clippy cleanupAlan Somers
* Fix race conditions in the tests. Two tests were grabbing a mutex but immediately dropping it. Thank you, Clippy. * Remove vestigial Windows support. Remove some code added to support Windows in 2015. Nix is no longer intended to ever run on Windows. * Various other minor Clippy lints.
2021-05-31Merge #1437bors[bot]
1437: Add MS_LAZYTIME flag r=asomers a=ManaSugi MS_LAZYTIME (since Linux 4.0) reduces on-disk updates of inode timestamps (atime, mtime, ctime) by maintaining these changes only in memory. MS_LAZYTIME is available from `libc` v0.2.95. Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com> Co-authored-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-05-31Add MS_LAZYTIME flagManabu Sugimoto
MS_LAZYTIME (since Linux 4.0) reduces on-disk updates of inode timestamps (atime, mtime, ctime) by maintaining these changes only in memory. Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-05-31Merge #1440bors[bot]
1440: Adapt aio to the world of async/await, and fix some potential unsound… r=asomers a=asomers …ness. * libc::aiocb must not be moved while the kernel has a pointer to it. This change enforces that requirement by using std::pin. * Split LioCbBuilder out of LioCb. struct LioCb relied on the (incorrect) assumption that a Vec's elements have a stable location in memory. That's not true; they can be moved during Vec::push. The solution is to use a Vec in the new Builder struct, but finalize it to a boxed slice (which doesn't support push) before allowing it to be submitted to the kernel. * Eliminate owned buffer types. mio-aio no longer uses owned buffers with nix::aio. There's little need for it in the world of async/await. I'm not aware of any other consumers. This substantially simplifies the code. Co-authored-by: Alan Somers <asomers@gmail.com>
2021-05-30Adapt aio to the world of async/await, and fix some potential unsoundness.Alan Somers
* libc::aiocb must not be moved while the kernel has a pointer to it. This change enforces that requirement by using std::pin. * Split LioCbBuilder out of LioCb. struct LioCb relied on the (incorrect) assumption that a Vec's elements have a stable location in memory. That's not true; they can be moved during Vec::push. The solution is to use a Vec in the new Builder struct, but finalize it to a boxed slice (which doesn't support push) before allowing it to be submitted to the kernel. * Eliminate owned buffer types. mio-aio no longer uses owned buffers with nix::aio. There's little need for it in the world of async/await. I'm not aware of any other consumers. This substantially simplifies the code.
2021-05-30Merge pull request #1442 from asomers/issue-1441Alan Somers
Suppress a build warning on Fuchsia
2021-05-30Suppress a build warning on FuchsiaAlan Somers
Beginning with 1.41.0, Rust considers it UB to zero-initialize a function pointer, even if you try to hide it behind `mem::MaybeUninit`. Suppress this warning to fix the build until we come up with a better permanent solution. Issue #1441
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