summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-12-03Update `mman` related docsSachin Cherian
- Add docs for `memfd_create`, `shm_open`, and `shm_unlink` - Add man-page links - Remove` #[allow(missing_docs)]`on the `memfd` module
2021-11-26Update doc comment to match type `Option<Signal>`Johannes Schilling
This has previously been done for `killpg`, but not `kill` it seems.
2021-11-17Fix documentation formating for pipe2rusty-snake
2021-10-23Merge #1565 #1566bors[bot]
1565: Update features::socket_atomic_cloexec r=asomers a=asomers Several platforms have long supported SOCK_OCLOEXEC. Mark them as supporting this feature. 1566: Correct definition of MADV_SOFT_OFFLINE on ppc r=asomers a=asomers Rust has no "ppc" target_arch. It should be "powerpc" or "powerpc64". Co-authored-by: Alan Somers <asomers@gmail.com>
2021-10-21Fix unsoundness in `FdSet` methodstaylor.fish
Ensure file descriptors are nonnegative and less than `FD_SETSIZE`. (Fixes #1572.)
2021-10-16Fix a Clippy warning on the latest nightlyAlan Somers
2021-10-16Correct definition of MADV_SOFT_OFFLINE on ppcAlan Somers
Rust has no "ppc" target_arch. It should be "powerpc" or "powerpc64".
2021-10-16Update features::socket_atomic_cloexecAlan Somers
Several platforms have long supported SOCK_OCLOEXEC. Mark them as supporting this feature.
2021-10-09sockopt's Set and Get traits are not unsafeAlan Somers
They were properly marked as unsafe as originally written. However, when the internal mem::zeroed() was replaced by mem::uninitialized(), these traits actually became safe. Only Get::assume_init() is actually unsafe. Fixes a warning with the latest Clippy.
2021-09-29Merge #1538 #1545 #1546bors[bot]
1538: posix_fadvise doesn't return -1 as sentinel value r=asomers a=ocadaruma ## Summary - `posix_fadvise(2)` does return error number directly (i.e. not through `errno`) * refs: https://man7.org/linux/man-pages/man2/posix_fadvise.2.html , https://man7.org/linux/man-pages/man2/posix_fadvise.2.html - However `posix_fadvise`-binding uses `Errno::result` to translate the error now, which is mis-use. 1545: Fix memory unsafety in unistd::getgrouplist r=asomers a=asomers Fixes #1541 1546: Revert "Expose SockAddr::from_raw_sockaddr" r=asomers a=asomers This reverts commit ed43d2c65e65dd68c9cf2dcf06f5ec45a44aaccd. As discussed in #1544 the API of this function needs to change. For now, revert the PR that made it public, because it has not yet been included in any release. Co-authored-by: Haruki Okada <ocadaruma@gmail.com> Co-authored-by: vitalyd <vitalyd@gmail.com> Co-authored-by: Alan Somers <asomers@gmail.com>
2021-09-28Fix return value of posix_fadviseHaruki Okada
libc::posix_fadvise returns errnos directly rather than in the errno variable.
2021-09-28Revert "Expose SockAddr::from_raw_sockaddr"Alan Somers
This reverts commit ed43d2c65e65dd68c9cf2dcf06f5ec45a44aaccd. As discussed in #1544 the API of this function needs to change. For now, revert the PR that made it public, because it has not yet been included in any release.
2021-09-28Fix memory unsafety in unistd::getgrouplistvitalyd
Fixes #1541
2021-09-28Merge #1536bors[bot]
1536: Lower limits in setrlimit example r=asomers a=rtzoeller The current values causes the doc test to fail on Fedora 34 for unprivileged users. The values can be lowered without meaningfully changing the example. Previously the example failed with EPERM. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2021-09-20Lower limits in setrlimit exampleRyan Zoeller
The current value causes the doc test to fail on Fedora 34 for unprivileged users.
2021-09-19Fix #411 - Provide accessors for 'events' in PollFdConrad Meyer
Test: `cargo test --test test test_pollfd_events`
2021-09-19Actually connect the mman tests to the buildAlan Somers
This was an oversight from #1306. Reported-by: @ocadaruma
2021-09-19Merge #1531bors[bot]
1531: mman add MAP_CONCEAL mmap flag for openbsd r=asomers a=devnexen Co-authored-by: David Carlier <devnexen@gmail.com>
2021-09-19mman add MAP_CONCEAL mmap flag for openbsdDavid Carlier
2021-09-19Merge #1532bors[bot]
1532: mman MAP_JIT flag documentation. r=asomers a=devnexen Co-authored-by: David Carlier <devnexen@gmail.com>
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 MAP_JIT flag documentation.David Carlier
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-12Prevent buffer over-read in getgroups()Jan Verbeek
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-08Make Errno::result() inlinelinkmauve
This makes the success case a single `cmpl $-1, %eax` followed with a non-taken conditional jump, instead of the current `callq` which is always taken. I have not benchmarked the difference, but it is an obvious improvement.
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-07Implement AsRawFd for PollFdConrad Meyer
Implement the trait on PollFd, providing an `as_raw_fd()` accessor to get the RawFd associated with the PollFd. Subsumes #1147, #1286. Closes #1146. Test: `cargo test --test test test_pollfd_fd`
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-28Merge #1507 #1508bors[bot]
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>