Age | Commit message (Collapse) | Author |
|
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>
|
|
1465: Enable creating a const TimeSpec r=asomers a=danieldulaney
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 an `std::time::Duration`.
An alternative approach would be to make the inner `timespec` field `pub`, which would not require any additional functions but would expose some (potentially unwanted) implementation details.
Co-authored-by: Daniel Dulaney <dulaney.daniel@gmail.com>
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
1470: Add the IPV6_V6ONLY sockopt r=asomers a=danieldulaney
`IPV6_V6ONLY` allows the user to select between dual-stack and IPv6-only sockets.
Platform support seems to be good; all platforms with IPv6 support seem to have this sockopt.
Co-authored-by: Daniel Dulaney <dulaney.daniel@gmail.com>
|
|
1469: Fix CONTRIBUTING.md formating r=asomers a=rusty-snake
Guess the label prefixes should be rendered bold and not with literal stars.
Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com>
|
|
|
|
1467: Add more errno definitions for better backwards compat with 0.21.0 r=asomers a=asomers
Fixes #1464
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
Guess the label prefixes should be rendered bold and not with literal stars.
[skip ci]
|
|
Fixes #1466
|
|
|
|
Use immutable receivers for FdSet::{highest, contains, fds}
|
|
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
|
|
Slim down the size of the built package
|
|
|
|
The exclude list had gotten out-of-date.
|
|
1462: Fix fork test and enable doc test r=asomers a=sporksmith
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.
Co-authored-by: Jim Newsome <jnewsome@torproject.org>
|
|
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.
|
|
Release v0.22.0
|
|
|
|
1455: Support SO_RXQ_OVFL socket option (android/fuchsia/linux) r=asomers a=junhochoi
This PR implements support of RXQ_OVFL flag and parsing ControlMessage
to get the packet drop counter of UDP socket.
Co-authored-by: Junho Choi <junho@cloudflare.com>
|
|
This PR implements support of RXQ_OVFL flag and parsing ControlMessage
to get the packet drop counter of UDP socket.
|
|
1458: Added support for renameat2 on linux r=asomers a=tomboland
Hi, please find my PR for adding the linux-specific `renameat2` syscall. It's largely similar to `renameat`, with an additional flags parameter:
The flags are:
* RENAME_REPLACE - performs an atomic swap.
* RENAME_NOREPLACE - returns EEXIST if the target already exists.
* RENAME_WHITEOUT - specific to overly/union filesystems, and I haven't added a test-case for this one.
PLEASE NOTE: It looks like my formatter has made numerous changes. If you have a preferred formatting config then please let me know, and I can push up changes consistent with the accepted style.
I'm not all that experienced with rust, and this is my first time looking at the nix project, so I'm more than happy to receive guidance on improving my submission.
Cheers!
Co-authored-by: Tom Boland <tom@t0mb.net>
|
|
|
|
1446: Overhaul Nix's error types r=asomers a=asomers
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>, and the few functions that must return
unusual errors like InvalidUtf8 should use bespoke error types.
This commit prototypes that approach by modifying just one function, for
now, to use the new error type.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
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
|
|
|
|
1460: Bump libc to 0.2.98 r=asomers a=nox
A new libc release with the MNT_ fixes was released.
Co-authored-by: Anthony Ramine <nox@nox.paris>
|
|
A new libc release with the MNT_ fixes was released.
|
|
Reported by: Anthony Ramine <@nox>
|
|
1457: Add TcpUserTimeout socket option r=asomers a=nox
Co-authored-by: Anthony Ramine <nox@nox.paris>
|
|
|
|
1456: Add IpFreebind socket option r=asomers a=nox
Co-authored-by: Anthony Ramine <nox@nox.paris>
|
|
|
|
1454: Missing changes from PR #1453 r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
1453: Add nmount for FreeBSD. r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
Fix several problems with Errno aliases
|
|
|
|
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.
|
|
Fix some warnings, and reenble tests that were broken on Travis
|
|
|
|
|