summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-14reimplement recvmsg/sendmmsgMichael Baikov
New implementation performs no allocations after all the necessary structures are created, removes potentially unsound code that was used by the old version (see below) and adds a bit more documentation about bugs in how timeout is actually handled ``` let timeout = if let Some(mut t) = timeout { t.as_mut() as *mut libc::timespec } else { ptr::null_mut() }; ```
2022-10-14Update changelogMichael Baikov
2022-10-14pack_mhdr_to_receive: pass iovec ptr and capacity separatelyMichael Baikov
We'll be using that to reinitialize buffers later
2022-10-14pack_mhdr_to_receive: pass pointer and capacity directlyMichael Baikov
This is already an unsafe function, dealing with pointers directly does not make it much more unsafe but simplifies lifetimes later on and similar to a previous commit allows to alocate a single buffer to store all the control messages
2022-10-14socket: stop setting vector length inside read_mhdrMichael Baikov
CMSG_FIRSTHDR/CMSG_NEXTHDR operate in terms of pointers contained inside msghdr structure, vector capacity doesn't matter for them. This would change external behavior of recvmsg/recvmmsg in a sense that buffer passed to store controll messages won't have it's length updated but intended way to receive control messages is with cmsgs iterator on `RecvMsg` which would still work. This change is required to allow using a single vector to store control messages from multiple packets
2022-10-13Merge #1743bors[bot]
1743: add XFS_SUPER_NUMBER to nix::sys::statfs r=rtzoeller a=MrCroxx Close #1742 . Co-authored-by: MrCroxx <mrcroxx@outlook.com>
2022-10-13add XFS_SUPER_NUMBER to nix::sys::statfsMrCroxx
2022-10-13Merge #1842bors[bot]
1842: add eaccess on freebsd, dragonfly and linux r=rtzoeller a=SteveLauC #### man pages * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=eaccess&sektion=2&n=1) * [DragonFly](https://man.dragonflybsd.org/?command=access&section=2) * [Linux](https://man7.org/linux/man-pages/man3/euidaccess.3.html) #### difference between `eaccess` and `access/faccessat` IMHO, `eaccess` uses effective identifiers to perform the permission check while `access/faccessat` use real IDs. Fixes #1373 Co-authored-by: Steve Lau <stevelauc@outlook.com>
2022-10-13Merge #1846bors[bot]
1846: fix '<newline>' being interpreted as html r=asomers a=rtzoeller This is breaking nightly. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-10-12fix '<newline>' being interpreted as htmlRyan Zoeller
2022-10-13add eaccess on FreeBSD, DragonFly and Linux (musl and glibc)Steve Lau
2022-10-13Merge #1843bors[bot]
1843: Fix typo: remove unnecessary verb from doc comment of `dup` r=rtzoeller a=magurotuna Extremely minor one, but I found it by chance so why not open a PR :) Co-authored-by: Yusuke Tanaka <yusuktan@maguro.dev>
2022-10-11Remove unnecessary verb from doc comment of `dup`Yusuke Tanaka
2022-10-10Merge #1841bors[bot]
1841: add faccessat on illumos r=asomers a=SteveLauC This binding has been added in [libc#2953](https://github.com/rust-lang/libc/pull/2953) Co-authored-by: Steve Lau <stevelauc@outlook.com>
2022-10-10add faccessat on illumosSteve Lau
2022-10-09Merge #1840bors[bot]
1840: Upgrade parking_lot dev-dependency to 0.12 r=asomers a=rtzoeller We were previously stuck on 0.11 for MSRV reasons, but since bumping nix's MSRV to Rust 1.56 this is no longer the case. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-10-08Upgrade parking_lot dev-dependency to 0.12Ryan Zoeller
We were previously stuck on 0.11 for MSRV reasons, but since bumping nix's MSRV to Rust 1.56 this is no longer the case.
2022-10-08Merge #1833bors[bot]
1833: add syncfs on linux r=rtzoeller a=SteveLauC Fixes #1818 Change has not been added to `CHANGELOG.md`, will add it when #1831 is merged, or there will be a merge conflict Co-authored-by: Steve Lau <stevelauc@outlook.com>
2022-10-08Merge #1839bors[bot]
1839: Fix clippy warnings on nightly r=asomers a=rtzoeller Clippy is now smarter about detecting unnecessary casts and useless conversions, which means we need to be more explicit about when the conversions are needed for a subset of platforms. Required changes found by repeatedly running the following command against a list of the supported platforms. `xargs -t -I {} sh -c "cargo clippy -Zbuild-std --target {} --all-targets -- -D warnings || exit 255"` I removed the casts it complained about, and then restored them with an `#[allow]` if a later target needed the cast. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-10-08Fix clippy warnings on nightlyRyan Zoeller
Clippy is now smarter about detecting unnecessary casts and useless conversions, which means we need to be more explicit about when the conversions are needed for a subset of platforms. Required changes found by repeatedly running the following command against a list of the supported platforms. `xargs -t -I {} sh -c "cargo clippy -Zbuild-std --target {} --all-targets -- -D warnings || exit 255"` I removed the casts it complained about, and then restored them with an `#[allow]` if a later target needed the cast.
2022-10-08add syncfs on linuxSteve Lau
2022-10-08Merge #1831bors[bot]
1831: re-export RLIM_INFINITY from libc r=rtzoeller a=SteveLauC Fixes #1803 Co-authored-by: Steve Lau <stevelauc@outlook.com>
2022-10-02re-export RLIM_INFINITY from libcSteve Lau
2022-10-01Merge #1829bors[bot]
1829: statfs: add namespace fs magic r=rtzoeller a=tammela Namespace filesystem magic is missing from FsType constants. Co-authored-by: Pedro Tammela <pctammela@gmail.com>
2022-09-30libc: bump libc to 0.2.134Pedro Tammela
2022-09-30statfs: add namespace fs magicPedro Tammela
Namespace filesystem magic is missing from FsType constants.
2022-09-27Merge #1825bors[bot]
1825: Add a `sched_getcpu` wrapper r=rtzoeller a=jonas-schievink Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-09-27Add a `sched_getcpu` wrapperJonas Schievink
2022-09-27Merge #1828bors[bot]
1828: bump libc to 0.2.133 r=rtzoeller a=SteveLauC Bump `libc` so that `setgrent/getgrent/endgrent` are available on fuchsia, and thus the CI failure in #1820 will be resolved Co-authored-by: Steve Lau <stevelauc@outlook.com>
2022-09-25bump libc to 0.2.133Steve Lau
2022-09-24Merge #1824bors[bot]
1824: fix bugs on android armv7, because `pw.pw_passwd.is_null()` r=rtzoeller a=ClarkGuan crash on my Android phone because `pw.pw_passwd == NULL` Co-authored-by: wdsgyj <gongbo.guan@momenta.ai>
2022-09-25fix crash on Android platformwdsgyj
2022-09-17Merge #1817bors[bot]
1817: fix issue1814 add domainname field of utsname on android and linux r=asomers a=SteveLauC Closes #1814 Co-authored-by: Steve Lau <stevelauc@outlook.com> Co-authored-by: SteveLau <stevelauc@outlook.com>
2022-09-12Merge branch 'master' into issue1814-expose-domainname-of-utsnameSteveLau
2022-09-12Merge #1808bors[bot]
1808: expose memfd on freebsd r=asomers a=i509VCB Resolves #1775 Co-authored-by: i509VCB <git@i509.me>
2022-09-12Merge #1815bors[bot]
1815: Handle unacceptable name gracefully in {User,Group}::from_name r=asomers a=magicant Calling `unwrap` on the result of `CString::new` may cause the current thread to panic, which is a bit surprising undocumented behavior. It would be more reasonable to treat the erroneous name as a non-existing user or group. Co-authored-by: WATANABE Yuki <magicant@wonderwand.net>
2022-09-12fix issue1814Steve Lau
2022-09-11Merge #1816bors[bot]
1816: Clippy cleanup r=rtzoeller a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2022-09-11Clippy cleanupAlan Somers
2022-09-11Handle unacceptable name gracefully in {User,Group}::from_nameWATANABE Yuki
Calling `unwrap` on the result of `CString::new` may cause the current thread to panic, which is a bit surprising undocumented behavior. It would be more reasonable to treat the erroneous name as a non-existing user or group.
2022-09-07expose memfd on freebsdi509VCB
2022-08-26Merge #1810bors[bot]
1810: Eliminate Cargo.lock.msrv r=rtzoeller a=asomers We no longer need it since updating our MSRV to 1.56.1. Issue #1809 Co-authored-by: Alan Somers <asomers@gmail.com>
2022-08-25Eliminate Cargo.lock.msrvAlan Somers
We no longer need it since updating our MSRV to 1.56.1. Issue #1809
2022-08-26Merge #1804bors[bot]
1804: Add sched_getaffinity and sched_setaffinity on FreeBSD r=asomers a=rtzoeller Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-08-25Add sched_getaffinity and sched_setaffinity on FreeBSDRyan Zoeller
2022-08-22Merge #1805bors[bot]
1805: Add `line` field to `Termios` struct r=rtzoeller a=tertsdiepraam Fixes https://github.com/nix-rust/nix/issues/1802 I have to admit I'm not really sure how to test this properly, so if that's necessary I require some help :) Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
2022-08-22add line field to Termios structTerts Diepraam
2022-08-21Merge #1806bors[bot]
1806: Remove MSRV-related workaround for doc aliases r=asomers a=rtzoeller Remove the MSRV-related workaround added by #1693, since we now can use doc aliases in all supported versions of Rust. Closes #1674. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2022-08-20Remove MSRV-related workaround for doc aliasesRyan Zoeller
2022-08-21Merge #1801bors[bot]
1801: fix microsecond calculation for TimeSpec r=rtzoeller a=StephanvanSchaik The implementation of `num_microseconds()` for `TimeSpec` returns the number of seconds not microseconds, as it divided by the wrong factor. The number of nanoseconds should be divided by 1000 to get the number of microseconds. Co-authored-by: S.J.R. van Schaik <stephan@synkhronix.com>