summaryrefslogtreecommitdiff
path: root/src/sys
AgeCommit message (Collapse)Author
2021-09-19mman add MAP_CONCEAL mmap flag for openbsdDavid Carlier
2021-09-19Merge #1522bors[bot]
1522: mman mod adding MAP_ALIGNED_SUPER flag for freebsd. r=asomers a=devnexen Co-authored-by: David Carlier <devnexen@gmail.com>
2021-09-19Clippy cleanupAlan Somers
And this time, start running Clippy in CI
2021-09-19mman mod adding MAP_ALIGNED_SUPER flag for freebsd.David Carlier
2021-09-19Merge #1496bors[bot]
1496: Rework UnixAddr to fix soundness issues r=asomers a=coolreader18 Fixes #1494 I went with making `sun_path` always nul-terminated since that just seems to make things easier, since (at least according to linux man pages) `sockaddr_un`s returned by the kernel will always be nul-terminated. Co-authored-by: Noa <33094578+coolreader18@users.noreply.github.com>
2021-09-18mman: add MAP_EXCL flag for freebsd.David Carlier
2021-09-13Merge #1524bors[bot]
1524: Add docs for most sockopts r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2021-09-12Add docs for all sockopts that are documented by their respective OSesAlan Somers
2021-09-12Add the ability to set doc strings in sockopts' definitionsAlan Somers
2021-09-12Switch the argument order of sockopt_impl!Alan Somers
This macro is not exported outside of the crate, so there's no danger.
2021-09-12Merge #1520 #1523bors[bot]
1520: mman module netbsd additions. r=asomers a=devnexen 1523: mman: add MAP_STACK to openbsd which is needed … r=asomers a=devnexen …to created stack mappings Co-authored-by: David Carlier <devnexen@gmail.com>
2021-09-12mman module netbsd additions.David Carlier
2021-09-12mman: add MAP_STACK to openbsd which is needed to created stack mappingsDavid Carlier
2021-09-12Merge #1509 #1515bors[bot]
1509: Allow Android to use timerfd r=asomers a=rtzoeller This is a continuation of #1336 which also enables the timerfd tests. ``` running 3 tests test sys::test_timerfd::test_timerfd_unset ... ok test sys::test_timerfd::test_timerfd_oneshot ... ok test sys::test_timerfd::test_timerfd_interval ... ok ``` 1515: Add IP_TTL/IPV6_UNICAST_HOPS SockOpts r=asomers a=cemeyer Test: `cargo test --test test test_ttl_opts` Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com> Co-authored-by: Conrad Meyer <cem@FreeBSD.org>
2021-09-07Add IP_TTL/IPV6_UNICAST_HOPS SockOptsConrad Meyer
Test: `cargo test --test test test_ttl_opts`
2021-09-07Merge branch 'master' into socket-mssAlan Somers
2021-09-06Add support for IP_RECVERR and IPV6_RECVERRConrad Meyer
Setting these options enables receiving errors, such as ICMP errors from the network, via `recvmsg()` with `MSG_ERRQUEUE`. Adds new `Ipv{4,6}RecvErr` variants to `ControlMessageOwned`. These control messages are produced when `Ipv4RecvErr` or `Ipv6RecvErr` options are enabled on a raw or datagram socket. New tests for the functionality can be run with `cargo test --test test test_recverr`. This commit builds on an earlier draft of the functionality authored by Matthew McPherrin <git@mcpherrin.ca>.
2021-09-04Merge branch 'master' into socket-msseaon
2021-09-04Support for `TCP_MAXSEG` TCP MSS socket optioneaon
2021-09-04Check Dragonfly BSD and OpenBSD in CIAlan Somers
Build, but don't test, for these operating systems. Thanks to @rtzoeller for the tip. Also, fix the OpenBSD build.
2021-09-04Fix some broken internal doc links in the socket codeAlan Somers
2021-09-04Enable pwritev and preadv for more operating systems.Alan Somers
2021-09-04Remove SigevNotify on OpenBSD and RedoxAlan Somers
Because nothing uses it on those OSes.
2021-09-04Document more thingsAlan Somers
Also, test rustdoc in CI, and demote missing_docs from a deny to a warning (but still deny it in CI).
2021-08-31Allow Android to use timerfdRyan Zoeller
Co-authored-by: zachoverflow <zach@zachjohnson.net>
2021-08-29Rework UnixAddr to fix soundness issuesNoa
2021-08-28More rust docsAlan Somers
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-27Merge #1503bors[bot]
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-27Fix compilation warningsRyan Zoeller
2021-08-26add `TcpRepair` to sockopt0/0
2021-08-22Merge #1447bors[bot]
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-21Merge #1495bors[bot]
1495: Deprecate SockAddr/InetAddr::to_str r=asomers a=coolreader18 Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-08-21Expose SockAddr::from_raw_sockaddrNoah
2021-08-21Deprecate SockAddr/InetAddr::to_strNoah
2021-08-18Add `PTRACE_EVENT_STOP` enum variantGabriel Majeri
2021-08-18Merge #1486 #1490 #1493bors[bot]
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-17Relax assertions in sockaddr_storage_to_addr to match the documentation.Kyle Huey
Fixes #1479
2021-08-17Don't use mem::transmute in SignalFdAlan Somers
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-17Simplify definition of SIGNALFD_SIGINFO_SIZEAlan Somers
mem::size_of has been a const fn since Rust 1.24.0. Use it.
2021-08-13constify more functionsAlan Somers
Constify more functions, since we're raising the MSRV from 1.41.0 to 1.46.0. Fixes #1477
2021-08-12feat: add libc::IP6T_SO_ORIGINAL_DST supportIcemic
2021-08-11Merge #1482bors[bot]
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-11Merge #1484bors[bot]
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-10Add support for LOCAL_PEER_CREDAlan Somers
On FreeBSD and its derivatives, this socket option gets the credentials of the connected peer.
2021-08-09Optionally implement TryFrom in libc_enum!Alan Somers
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-09Replace some mem::transmute calls in signal.rs with pointer castsAlan Somers
Issue #373
2021-08-09Add PTRACE_INTERRUPTMika Vatanen
2021-08-09Remove some actually unsupported termios iflags on redoxNoah
2021-08-01Add getrlimit and setrlimitLMJW
This work is a continutation on previou contribution by @kpcyrd and @j1ah0ng.
2021-07-29Merge #1473 #1474 #1476bors[bot]
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>