Age | Commit message (Collapse) | Author |
|
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 .
|
|
Update CHANGELOG for #1198
|
|
|
|
|
|
1176: Add RISC-V support on GNU/Linux r=asomers a=msizanoen1
Co-authored-by: msizanoen1 <qtmlabs@protonmail.com>
|
|
The file documenting ioctl number assignment in the Linux kernel has been converted to ReStructuredText (see https://lwn.net/Articles/705224/ for some background), the file extension has naturally changed.
|
|
|
|
We were assuming the wrong types for f_iosize and f_ffree in struct
statfs on OpenBSD.
Fixes #1125
|
|
|
|
|
|
ignore really is the correct things to do for these doc tests.
compile_fail should only be used for examples that demonstrate a compile
failure by design, not for stuff that only works on one platform.
|
|
The old From implementation was actually falliable, and would panic on
failure.
|
|
Replace it with mem::zeroed. It isn't perfect, but it's better than it
was.
Issue #1115
|
|
1156: Remove the deprecated CmsgSpace r=asomers a=asomers
This eliminates one of the last remaining uninitialized memory accesses
in Nix.
Fixes #1142
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
This eliminates one of the last remaining uninitialized memory accesses
in Nix.
Fixes #1142
|
|
|
|
|
|
|
|
The fix for #1149 has the logic for the [cfg()] conditional inverted
so that the aliases for VMIN and VTIME are defined on targets that
are not linux-sparc64.
|
|
On sparc64, glibc defines VMIN as VEOF and VTIME as VEOL for
termios, so we need to inherit these alias definitions for
nix-rust as well.
Fixes #1149
|
|
1138: Add Signal::as_str() to get representation as static string r=asomers a=MikailBag
# Motivation
Currently string representation of signal can be obtained with AsRef<str> impl.
But it has downside: returned string's lifetime is bound to lifetime of signal, so &str must be converted to String. This allocation is avoidable, because as_ref() only returns static strings. To fix this problem, my PR adds Signal::as_str() method, which returns static string.
Co-authored-by: Mikail Bagishov <bagishov.mikail@yandex.ru>
|
|
|
|
recvfrom(2) only returns the sender's address for protocols that provide
it. Usually, that means it returns the sender's address for datagram
sockets but not for stream sockets.
Fixes #1144
|
|
Because of the use of MaybeUninit::uninit, the padding fields in msghdr,
which only present on musl builds, are not initialized. Causing garbage
data to be sent to the kernel. This change ensures the paddings are
always zeroed.
|
|
`assert_eq!` gives more debug info when the test fails by default than
`assert!`. This should help make debugging easier.
|
|
1120: Fix length of abstract socket address r=asomers a=yshui
NULL bytes have no special significance in an abstrace address, and the
length of the address is solely decided by the length member. If the
length is set to sun_path.len(), all the NULL bytes will be considered
part of the address.
Tests are updated accordingly.
Closes #1119
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
|
|
NULL bytes have no special significance in an abstrace address, and the
length of the address is solely decided by the length member. If the
length is set to sun_path.len(), all the NULL bytes will be considered
part of the address.
Tests are updated accordingly.
Closes #1119
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
|
|
TryFrom wasn't stable when that function was written.
|
|
Only two instances remain:
* For the deprecated sys::socket::CmsgSpace::new. We should probably
just remove that method.
* For sys::termios::Termios::default_uninit. This will require some
more thought.
Fixes #1096
|
|
|
|
It was leftover from internal churn during PR #1020.
|
|
|
|
|
|
|
|
1095: Fix warnings on Rust 1.37.0 r=asomers a=asomers
* Replace obsolete range syntax "..." with inclusive range "..="
* Use dyn Trait syntax instead of Box<Trait>
* Raise MSRV to 1.27.0 (for dyn Trait syntax)
* Test with nightly again
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
* Replace obsolete range syntax "..." with inclusive range "..="
* Use dyn Trait syntax instead of Box<Trait>
* Raise MSRV to 1.27.0 (for dyn Trait syntax)
* Raise MSRV to 1.31.0 (because of rand)
tempfile pulls in rand, and rand pulls in fuchsia-cprng, which requires
1.31.0. Why rand pulls in fuchsia-cprng I don't know. It's specified
as a target-specific dependency, but Cargo tries to build it anyway
(only on Linux, not on FreeBSD or OSX). A bug in Cargo 1.27.0?
|
|
This patch adds AF_VSOCK support to AddressFamily in order to use
VSOCK socket.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
928: Wrap libc::statfs r=asomers a=alesharik
Fix for [#926](https://github.com/nix-rust/nix/issues/926)
Co-authored-by: alesharik <alesharikreserv@yandex.ru>
|
|
|
|
|
|
Abstract paths should always be N-1 in length where N is the length of
the `sun_path` field (first byte is \0). Given that,
`UnixAddr::new_abstract()` should always return this N-1 length, not
just the length of the string provided (the rest of the array will be
\0s).
|
|
Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all
traits are supported by all types, which is why many are missing
some.
|
|
MSG_WAITALL can be useful with recv() to wait the full amount of data
requested.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
It's not sufficient to check for root privileges. In a container, the
euid may be root even though the user lacks some capabilities. Replace
this test's root check with a check for the CAP_NET_ADMIN capability
instead.
|
|
|
|
libc just changed the signedness of sigaction.sa_flags for Android.
https://github.com/rust-lang/libc/commit/841b3eb01644283c3c41ac1d1a2ddcec141f15f2
|
|
libc just undefined MADV_SOFT_OFFLINE on mips.
https://github.com/rust-lang/libc/pull/1365
Fixes #1074
|
|
|
|
|
|
|