2246 Commits

Author SHA1 Message Date
Ryan Zoeller
2a31ac127a Allow Android to use timerfd
Co-authored-by: zachoverflow <zach@zachjohnson.net>
2021-08-31 16:40:30 -06:00
bors[bot]
39c63662ed
Merge #1507 #1508
1507: Forbid dead code again r=asomers a=asomers

The old problems with bitflags no longer apply

1508: More rust docs r=asomers a=asomers

Switch from allow(missing_docs) to deny(missing_docs), which should
gradually help us moving forward.  Also, add a few missing docs, such as
for sched and aio.

Co-authored-by: Alan Somers <asomers@gmail.com>
2021-08-28 23:20:13 +00:00
Alan Somers
8cc140e2fe More rust docs
Switch from allow(missing_docs) to deny(missing_docs), which should
gradually help us moving forward.  Also, add a few missing docs, such as
for sched and aio.
2021-08-28 16:48:43 -06:00
bors[bot]
48fbce9f8f
Merge #1506
1506: Test Linux aarch64 on real aarch64 hardware. r=asomers a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
2021-08-28 14:31:02 +00:00
Alan Somers
18c095b367 Ignore vsock tests on Linux aarch64
Apparently AWS Graviton containers don't support it.  socket() retunrs
EAFNOSUPPORT in that environment.

Also, be more selective about skipping tests under QEMU

Instead of skipping them on architectures where we happen to use QEMU,
only skip them when QEMU is actually being used.
2021-08-27 22:31:20 -06:00
Alan Somers
a593227c7e Test Linux aarch64 on real aarch64 hardware. 2021-08-27 21:06:53 -06:00
bors[bot]
1ed72d4707
Merge #1499
1499: Print function name and missing capability when skipping tests r=asomers a=rtzoeller

Currently when a test is skipped due to missing capabilities, a nondescript message is logged to stderr.

Improve that message to include both the function name and missing capability, making it possible to inspect stderr to see which capabilities are missing, and which tests they impact.

Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2021-08-28 02:55:41 +00:00
bors[bot]
253075aeb0
Merge #1503
1503: Add TcpRepair to sockopt r=asomers a=tazz4843

This PR adds the `TCP_REPAIR` flag to `nix::sys::socket::sockopt` under the name `TcpRepair`.

Co-authored-by: 0/0 <zero@imaskeleton.me>
2021-08-27 04:16:59 +00:00
bors[bot]
f9d508fe31
Merge #1501 #1505
1501: Mark x86_64-unknown-illumos as Tier 2 r=asomers a=rtzoeller

Illumos support is automatically built, but the README does not reflect this.

1505: Fix build for DragonFlyBSD r=asomers a=rtzoeller

The build for DragonFlyBSD is currently failing, due to a missing field when initializing `passwd`.

Fix warnings due to types being referenced which are marked as deprecated in libc. These constants are unused by DragonFlyBSD and can be removed: e0d27d0105

Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2021-08-27 04:05:04 +00:00
Ryan Zoeller
8366b92ca7 Fix compilation warnings 2021-08-27 01:46:50 -05:00
Alan Somers
f6d2e152bb Fix bors
bors got broken by a spelling change in .cirrus.yml in
d20fe20af79cc6fa4528a8a170ad50a1319a1fbf that wasn't propagated to
bors.toml.
2021-08-26 22:03:20 -06:00
0/0
d5fdacbb4f
add TcpRepair to sockopt 2021-08-26 21:37:26 -06:00
Ryan Zoeller
fc7687dad8 Fix build for DragonFlyBSD 2021-08-25 18:01:11 -05:00
Ryan Zoeller
b08d135840 Mark x86_64-unknown-illumos as Tier 2 2021-08-23 18:22:07 -05:00
Ryan Zoeller
7ab6731cf6 Print function name and missing capability when skipping tests 2021-08-22 21:27:33 -05:00
Alan Somers
dab7332eab
Merge pull request #1497 from asomers/cirrus2
Multiple CI improvements
2021-08-22 10:47:41 -06:00
Alan Somers
d20fe20af7 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
2021-08-22 10:33:07 -06:00
Alan Somers
f3cb6b321f Fix building the tests for Redox and Illumos
Also, split the overbroad test_mknod_family into two tests
2021-08-22 10:31:39 -06:00
bors[bot]
28f547fa12
Merge #1447
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>
2021-08-22 00:35:32 +00:00
bors[bot]
426b09aad9
Merge #1495
1495: Deprecate SockAddr/InetAddr::to_str r=asomers a=coolreader18



Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-08-21 22:14:13 +00:00
Noah
ed43d2c65e
Expose SockAddr::from_raw_sockaddr 2021-08-21 17:00:07 -05:00
Noah
c96141d423
Deprecate SockAddr/InetAddr::to_str 2021-08-21 16:59:35 -05:00
bors[bot]
8866df67e3
Merge #1335
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>
2021-08-21 20:13:18 +00:00
Gabriel Majeri
2decd671f9 Add a changelog entry 2021-08-18 22:31:45 +03:00
Gabriel Majeri
19860eef4a Add PTRACE_EVENT_STOP enum variant 2021-08-18 22:31:45 +03:00
bors[bot]
7207004e10
Merge #1486 #1490 #1493
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>
2021-08-18 14:54:31 +00:00
bors[bot]
05657e21a7
Merge #1489
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>
2021-08-18 14:38:00 +00:00
Alan Somers
0163528865 [skip ci] Fix bors configuration
* 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) .
2021-08-18 08:31:47 -06:00
Kyle Huey
d133d3db76 Relax assertions in sockaddr_storage_to_addr to match the documentation.
Fixes #1479
2021-08-17 19:26:12 -07:00
Alan Somers
cb2bdb52b8 Don't use mem::transmute in SignalFd
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
2021-08-17 20:15:39 -06:00
Alan Somers
a5e0b723a2 Simplify definition of SIGNALFD_SIGINFO_SIZE
mem::size_of has been a const fn since Rust 1.24.0.  Use it.
2021-08-17 20:06:26 -06:00
Alex Touchet
c6ce95537c
Fix crates.io badge 2021-08-13 23:10:42 -07:00
Alan Somers
5ed5bb634f
Merge pull request #1492 from asomers/bitflags_1.3.1
Fix the build with bitflags-1.3.0 and newer
2021-08-13 18:08:02 -06:00
Alan Somers
8acdaef51a Remove support for 32-bit Apple targets 2021-08-13 17:58:33 -06:00
Alan Somers
7049d424f1 constify more functions
Constify more functions, since we're raising the MSRV from 1.41.0 to
1.46.0.

Fixes #1477
2021-08-13 17:45:49 -06:00
Alan Somers
5495bbce52 Fix the build with bitflags-1.3.0 and newer
Bitflags raised its MSRV in a minor version, forcing all consumers to
follow suit.

Fixes #1491
2021-08-13 17:39:04 -06:00
Alan Somers
e9ea8441ca Fix warnings with Rust 1.46.0 - 1.51.0, inclusive
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.
2021-08-13 17:34:22 -06:00
Bearice Ren
e6f972cde1
update CHANGELOG 2021-08-12 01:28:57 +08:00
Icemic
9844ba825b
feat: add libc::IP6T_SO_ORIGINAL_DST support 2021-08-12 01:11:11 +08:00
Alan Somers
5039222522 Forbid dead code again
The old problems with bitflags no longer apply
2021-08-10 19:14:47 -06:00
bors[bot]
06b5d3344a
Merge #1482
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>
2021-08-11 00:39:47 +00:00
bors[bot]
a7e86b2fda
Merge #1484
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>
2021-08-11 00:11:52 +00:00
Alan Somers
0d3bc089d5 Add support for LOCAL_PEER_CRED
On FreeBSD and its derivatives, this socket option gets the credentials
of the connected peer.
2021-08-10 17:57:32 -06:00
bors[bot]
2df8679237
Merge #1485
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>
2021-08-10 23:54:28 +00:00
Alan Somers
9df5abfab1 Optionally implement TryFrom in libc_enum!
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
2021-08-09 18:51:49 -06:00
Alan Somers
8af3414cc2 Replace some mem::transmute calls in signal.rs with pointer casts
Issue #373
2021-08-09 18:41:37 -06:00
Alan Somers
68488a4508 [skip ci] fix CHANGELOG after PR #1422 2021-08-09 11:17:43 -06:00
bors[bot]
c5590df59c
Merge #1422
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>
2021-08-09 20:16:35 +00:00
Mika Vatanen
1cbde2bb47 Add PTRACE_INTERRUPT 2021-08-09 20:29:44 +03:00
bors[bot]
4c4be116f6
Merge #1483
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>
2021-08-09 14:48:38 +00:00