summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-20Adds IP_TOS, IPV6_TCLASS and SO_PRIORITY sockopt wrappersmzachar
2022-11-19Merge #1872bors[bot]
1872: Misc internal optimizations r=rtzoeller a=asomers * Make ipv4addr_to_libc const * Use mem::transmute in ipv4addr_to_libc and ipv6addr_to_libc Fixes #1687 Fixes #1688 Co-authored-by: Alan Somers <asomers@gmail.com>
2022-11-19Merge #1869bors[bot]
1869: Mode flag documentation r=asomers a=JonathanWoollett-Light Adds rustdoc to the `sys::stat::Mode` bit flags. Co-authored-by: Jonathan <jonathanwoollettlight@gmail.com>
2022-11-19Misc internal optimizationsAlan Somers
* Make ipv4addr_to_libc const * Use mem::transmute in ipv4addr_to_libc and ipv6addr_to_libc Fixes #1687 Fixes #1688
2022-11-19Mode flag documentationJonathan
2022-11-12Merge #1860bors[bot]
1860: Nuke deprecated Errno flags r=rtzoeller a=SUPERCILEX `@rtzoeller` It's been quite a few releases since these have been deprecated, more bloat removal. Co-authored-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-11Nuke deprecated Errno flagsAlex Saveau
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-12Merge #1854bors[bot]
1854: Reformat everything r=rtzoeller a=SUPERCILEX Unfortunately, https://github.com/nix-rust/nix/pull/1748 didn't do the trick because of https://github.com/rust-lang/rustfmt/issues/3253. This PR fully enforces global formatting. Closes https://github.com/nix-rust/nix/issues/770 Co-authored-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-06Run a round of clippy to fix CIAlex Saveau
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-06Reformat everythingAlex Saveau
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-10-24Merge #1849bors[bot]
1849: Add a Statfs::flags method r=rtzoeller a=asomers It returns the mount flags on the BSDs. On Linux, it returns a slightly different set of flags. Co-authored-by: Alan Somers <asomers@gmail.com>
2022-10-23Add a Statfs::flags methodAlan Somers
It returns the mount flags on the BSDs. On Linux, it returns a slightly different set of flags.
2022-10-23Define `MntFlags` and `unmount` on all of the BSDs.Alan Somers
2022-10-23On Linux-like operating systems, use statfs64 instead of statfs.Alan Somers
And fstatfs64 instead of fstatfs.
2022-10-23Suppress deprecation warnings from the latest libcAlan Somers
https://github.com/rust-lang/libc/pull/2963
2022-10-14Merge #1744bors[bot]
1744: reimplement sendmmsg/recvmmsg with better API r=rtzoeller a=pacak Motivation is explained in #1602, new version allows to receive data without performing allocations inside the receive loop and to use received data without extra copying. This pull request contains a breaking change to API `recvmmsg` (obviously) and also affects `recvmsg` - new version does not set length of control message buffer if one is passed. Later change can be avoided with a bit more copy-paste. Fixes #1602 Co-authored-by: Michael Baikov <manpacket@gmail.com>
2022-10-14include docsMichael Baikov
2022-10-14disable a flaky test on aarch64Michael Baikov
See https://github.com/nix-rust/nix/pull/1744 for more details
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