Age | Commit message (Collapse) | Author |
|
|
|
Multiple CI improvements
|
|
* Install cross the easy way, via cargo
* Don't test in release mode. Nix contains no release-dependent paths,
and release mode testing has to my knowledge never revealed a bug in
Nix.
* Add Linux powerpc back to CI, fixed by the latest cross.
* Check the tests even on platforms that can't run them.
* DRY for the Illumos and Redox sections
* Cross-check iOS from a Linux VM instead of OSX
* Revert the workaround for rust-lang/rustup issue 2774
|
|
Also, split the overbroad test_mknod_family into two tests
|
|
1447: Expose SockAddr::from_raw_sockaddr r=asomers a=coolreader18
I also noticed the `SockAddr/InetAddr::to_str` functions were entirely redundant - `ToString` exists for that, & has a blanket impl on `T: Display`.
Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
|
|
1495: Deprecate SockAddr/InetAddr::to_str r=asomers a=coolreader18
Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
|
|
|
|
|
|
1335: Add `PTRACE_EVENT_STOP` enum variant r=asomers a=GabrielMajeri
Adds the `PTRACE_EVENT_STOP` variant to the `ptrace::Event` enum.
Smaller part of #1279
Closes #1334
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.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>
|
|
1489: Don't use mem::transmute in SignalFd r=asomers a=asomers
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
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
* I never removed 32-bit OSX and iOS targets that were removed from
Cirrus in PR #1492 .
* I never added Fuchsia (PR #1285) .
* I never added illumos (PR #1394) .
* never added Linux x32 (PR #1366) .
|
|
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.
|
|
|
|
Fix the build with bitflags-1.3.0 and newer
|
|
|
|
Constify more functions, since we're raising the MSRV from 1.41.0 to
1.46.0.
Fixes #1477
|
|
Bitflags raised its MSRV in a minor version, forcing all consumers to
follow suit.
Fixes #1491
|
|
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.
|
|
1485: Replace some mem::transmute calls in signal.rs with pointer casts r=asomers a=asomers
Issue #373
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
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
|
|
|
|
1422: Add PTRACE_INTERRUPT call as `ptrace::interrupt(pid)` r=asomers a=blaind
I've based the test on `fn test_ptrace_cont`. Removed some parts, but not 100% sure what's the proper way of testing in nix context.
From ptrace-man page:
```
PTRACE_INTERRUPT (since Linux 3.4)
Stop a tracee. If the tracee is running or sleeping in
kernel space and PTRACE_SYSCALL is in effect, the system
call is interrupted and syscall-exit-stop is reported.
(The interrupted system call is restarted when the tracee
is restarted.) If the tracee was already stopped by a
signal and PTRACE_LISTEN was sent to it, the tracee stops
with PTRACE_EVENT_STOP and WSTOPSIG(status) returns the
stop signal. If any other ptrace-stop is generated at the
same time (for example, if a signal is sent to the
tracee), this ptrace-stop happens. If none of the above
applies (for example, if the tracee is running in user
space), it stops with PTRACE_EVENT_STOP with
WSTOPSIG(status) == SIGTRAP. PTRACE_INTERRUPT only works
on tracees attached by PTRACE_SEIZE.
```
Co-authored-by: Mika Vatanen <blaind@blaind.net>
|
|
|
|
1483: Remove some actually unsupported termios iflags on redox r=asomers a=coolreader18
Related to rust-lang/libc#2327
Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
|
|
|
|
1302: Add getrlimit and setrlimit r=asomers a=LMJW
This PR is based on the previous PR https://github.com/nix-rust/nix/pull/1190, which has not been updated for a very long time.
I have fixed the segfault and compilation error of the original PR and rebased the changes to the latest master branch.
Please let me know if anything need to been changed.
Co-authored-by: LMJW <heysuperming@gmail.com>
|
|
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>
|
|
1481: Include `sys::eventfd` for target_os = "android" r=asomers a=flxo
Androids bionic [supports](https://android.googlesource.com/platform/bionic/+/d1ad4f6/libc/include/sys/eventfd.h) `eventfd`. The `libc` crate also exposes [`eventfd`](https://github.com/rust-lang/libc/blob/36a6a8e254db89cd31d178b4ba102055ceabf9a8/src/unix/linux_like/android/mod.rs#L2648) for target `android`.
Extend the conditional compilation check to include the target_os "android".
Fixes #1480
Co-authored-by: Felix Obenhuber <felix@obenhuber.de>
|
|
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.
|
|
1471: unistd: Add conversion from User to libc::passwd r=asomers a=orvij
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
Exposes the `User::gecos` field to 64-bit Android builds, since `libc::passwd::pw_gecos` is supported on those builds
Co-authored-by: orvij <85481483+orvij@users.noreply.github.com>
|
|
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>
|
|
|
|
|
|
Since libc may add new variants at any time, Nix's consumers should not
use exhaustive match patterns.
Fixes #1182
|