Age | Commit message (Collapse) | Author |
|
1495: Deprecate SockAddr/InetAddr::to_str r=asomers a=coolreader18
Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
|
|
|
|
|
|
1486: Relax assertions in sockaddr_storage_to_addr to match the documentation. r=asomers a=khuey
Fixes #1479
1490: add libc::IP6T_SO_ORIGINAL_DST to socket opt r=asomers a=bearice
the original PR #1410 was stalled for a while
let's make it happen.
this should closes #1410 and #938
1493: Fix crates.io badge r=asomers a=atouchet
Co-authored-by: Kyle Huey <khuey@kylehuey.com>
Co-authored-by: Icemic <bingfeng.web@gmail.com>
Co-authored-by: Bearice Ren <bearice@icybear.net>
Co-authored-by: Alex Touchet <alextouchet@outlook.com>
|
|
Fixes #1479
|
|
There was a better case for using it before mem::uninitialized was
available, but not great. Even before then, mem::zeroed could've been
used instead.
Issue #373
|
|
mem::size_of has been a const fn since Rust 1.24.0. Use it.
|
|
Constify more functions, since we're raising the MSRV from 1.41.0 to
1.46.0.
Fixes #1477
|
|
These ranges of rustc are pickier about where to place
an #[allow(unused_doc_comments)] attribute. It caused warnings when
building for BSD-based targets.
|
|
|
|
1482: Add support for LOCAL_PEER_CRED r=asomers a=asomers
On FreeBSD and its derivatives, this socket option gets the credentials
of the connected peer.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
1484: Optionally implement TryFrom in libc_enum! r=asomers a=asomers
This saves code in several separate places that need to do this
separately. At the same time, remove a few uses of mem::transmute that
were implementing TryFrom or similar functionality.
Issue #373
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
On FreeBSD and its derivatives, this socket option gets the credentials
of the connected peer.
|
|
This saves code in several separate places that need to do this
separately. At the same time, remove a few uses of mem::transmute that
were implementing TryFrom or similar functionality.
Issue #373
|
|
Issue #373
|
|
|
|
|
|
This work is a continutation on previou contribution by @kpcyrd and @j1ah0ng.
|
|
1473: sys/stat: add a safe wrapper for mknodat(2) r=asomers a=lucab
This introduces a new `mknodat` helper.
Ref: https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknod.html
1474: Mark most C-derived enums as non_exhaustive r=asomers a=asomers
Since libc may add new variants at any time, Nix's consumers should not
use exhaustive match patterns.
Fixes #1182
1476: Constify many functions r=asomers a=asomers
Constify most functions that can be constified. The exceptions are
mostly accessors for structs that have no const constructor.
Co-authored-by: Luca BRUNO <luca.bruno@coreos.com>
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
This introduces a new `mknodat` helper.
Ref: https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknod.html
|
|
Androids bionic supports eventfd. Extend the conditional compilation
check to include the target_os "android".
Fixes #1480
|
|
Constify most functions that can be constified. The exceptions are
mostly accessors for structs that have no const constructor.
|
|
Add From<User> for libc::passwd trait implementation to convert
a User into a libc::passwd
Implementation consumes the User struct, giving ownership over
the internal members to the libc::passwd struct
Add the User::gecos field to 64-bit Android builds, since it is
supported by libc::passwd for those builds
|
|
1472: Add pthread_kill r=asomers a=mkroening
This adds `pthread_kill`, following the design of `killpg`.
What do you think?
Co-authored-by: Martin Kröning <mkroening@posteo.net>
|
|
|
|
|
|
Since libc may add new variants at any time, Nix's consumers should not
use exhaustive match patterns.
Fixes #1182
|
|
|
|
Fixes #1466
|
|
Previously, there was no way to create a TimeSpec in a const context
because all creation was through traits. This adds two utility
functions to create a const TimeSpec from a libc::timespec or a
std::time::Duration
|
|
There was never any good reason to use mutable receives in the first
place. Nix originally did so because libc defined FD_ISSET as taking a
mutable receiver, which it did based on an inaccurate Linux man page.
But that's fixed now.
https://github.com/rust-lang/libc/pull/1725
|
|
Replaces `println!` with raw `libc::write`. `println!` isn't guaranteed
to be async-signal-safe, and almost certainly *isn't* due to internal
buffering and locking.
Adds a call to `libc::_exit` in the child arm, so that it doesn't fall
through and start executing the parent code.
Adds a call to `waitpid` in the parent arm, to clean up the child
process.
Removes the `no_run` directive, so that it's run in the doc tests.
|
|
This PR implements support of RXQ_OVFL flag and parsing ControlMessage
to get the packet drop counter of UDP socket.
|
|
|
|
Now that Nix's weird error types are eliminated, there's no reason not
to simply use Errno as the Error type.
|
|
For many of Nix's consumers it be convenient to easily convert a Nix
error into a std::io::Error. That's currently not possible because of
the InvalidPath, InvalidUtf8, and UnsupportedOperation types that have
no equivalent in std::io::Error.
However, very few of Nix's public APIs actually return those unusual
errors. So a more useful API would be for Nix's standard error type to
implement Into<std::io::Error>.
This commit makes Error a simple NewType around Errno. For most
functions it's a drop-in replacement. There are only three exceptions:
* clearenv now returns a bespoke error type. It was the only Nix
function whose error couldn't be cleanly mapped onto an Errno.
* sys::signal::signal now returns Error(Errno::ENOTSUP) instead of
Error::UnsupportedOperation when the user passes an incompatible
argument to `handler`.
* When a NixPath exceeds PATH_MAX, it will now return
Error(Errno::ENAMETOOLONG) instead of Error::InvalidPath.
In the latter two cases there is now some abiguity about whether the
error code was generated by Nix or by the OS. But I think the ambiguity
is worth it for the sake of being able to implement Into<io::Error>.
This commit also introduces Error::Sys() as a migration aid. Previously
that as an enum variant. Now it's a function, but it will work in many
of the same contexts as the original.
Fixes #1155
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
Previously these were aliases for UnknownErrno. Now, they're compile
errors.
|
|
Hopefully fix unreliability in unistd::alarm's doc test
|
|
|
|
|
|
|
|
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.
|
|
|