about summary refs log tree commit diff
path: root/library/std/src/sys/unix/ext/net
AgeCommit message (Collapse)AuthorLines
2021-05-03Move `std::sys::unix::ext` to `std::os::unix`Christiaan Dirkx-3539/+0
2021-05-02Change 'NULL' to 'null'Brent Kerby-2/+2
2021-04-25Inline most raw socket, fd and handle conversionsKaiJewson-0/+12
2021-03-30Rollup merge of #83374 - reyk:fix/bsd-ancillary, r=joshtriplettDylan DPC-23/+34
unix: Fix feature(unix_socket_ancillary_data) on macos and other BSDs This adds support for CMSG handling on macOS and fixes it on OpenBSD and possibly other BSDs. When traversing the CMSG list, the previous code had an exception for Android where the next element after the last pointer could point to the first pointer instead of NULL. This is actually not specific to Android: the `libc::CMSG_NXTHDR` implementation for Linux and emscripten have a special case to return NULL when the length of the previous element is zero; most other implementations simply return the previous element plus a zero offset in this case. This MR makes the check non-optional which fixes CMSG handling and a possible endless loop on such systems; tested with file descriptor passing on OpenBSD, Linux, and macOS. This MR additionally adds `SocketAncillary::is_empty` because clippy is right that it should be added. This belongs to the `feature(unix_socket_ancillary_data)` tracking issue: https://github.com/rust-lang/rust/issues/76915 r? `@joshtriplett`
2021-03-26unix: Fix feature(unix_socket_ancillary_data) on macos and other BSDsReyk Floeter-23/+34
This adds support for CMSG handling on macOS and fixes it on OpenBSD and other BSDs. When traversing the CMSG list, the previous code had an exception for Android where the next element after the last pointer could point to the first pointer instead of NULL. This is actually not specific to Android: the `libc::CMSG_NXTHDR` implementation for Linux and emscripten have a special case to return NULL when the length of the previous element is zero; most other implementations simply return the previous element plus a zero offset in this case. This MR additionally adds `SocketAncillary::is_empty` because clippy is right that it should be added.
2021-03-26Use iter::zip in library/Josh Stone-2/+2
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-6/+6
2021-02-28unix: Non-mutable bufs in send_vectored_with_ancillary_toLinkTed-45/+48
Change the arguments of `send_vectored_with_ancillary` and `send_vectored_with_ancillary_to` to take an non-mutable bufs.
2020-12-16Fix failing build of std on armv5te-unknown-linux-uclibceabi due to missing ↵Ondrej Perutka-1/+5
cmsg_len_zero
2020-11-26Add comment for the previous android bug fixLinkTed-0/+4
2020-11-24Bug fix for android platform, because of the wrong behavior of CMSG_NXTHDRLinkTed-0/+19
2020-11-04Fix docs for MacOs (again)LinkTed-1/+2
2020-11-03Fix docs for MacOs (correction)LinkTed-1/+2
2020-10-28Fix test cases for MacOsLinkTed-2/+28
2020-10-17Fix cannot find type `ucred` for MacOs by using fake definitionsLinkTed-1/+1
2020-10-11Fix unresolved imports for `recv_vectored_with_ancillary_from`, ↵LinkTed-0/+1
`send_vectored_with_ancillary_to` and `SocketAncillary`
2020-10-10Fix unresolved link to `SocketAncillary`LinkTed-0/+2
2020-10-10Fix `libc` is ambiguous for WindowsLinkTed-9/+6
2020-10-10Fix import errors for `#[cfg(doc)]` targetLinkTed-2/+4
2020-10-10Add fake definitions for WindowsLinkTed-0/+10
2020-10-10Fix imports for MacOsLinkTed-8/+4
2020-10-10Change imports for `cfg(doc)`LinkTed-30/+29
2020-10-10Remove `passcred` for `emscripten`LinkTed-4/+4
2020-10-10Remove unnecessary trailing semicolonLinkTed-1/+1
2020-10-10Fix type mismatching for different OSes.LinkTed-41/+105
2020-10-10Remove `SocketCred` for `emscripten`LinkTed-13/+9
2020-10-10Fix unused import for `IoSliceMut` for macosLinkTed-0/+9
2020-10-10Add conditional compilation for importLinkTed-0/+1
2020-10-10Fix cfg condition for testLinkTed-1/+1
2020-10-10Remove `target_os`, which does not have `SO_PASSCRED` constant in `libc`LinkTed-56/+5
2020-10-10Remove `target_os`, which does not have `cmsghdr` struct in `libc`LinkTed-12/+0
2020-10-10Remove `target_os`, which does not have `MSG_CMSG_CLOEXEC` constant in `libc`LinkTed-54/+31
2020-10-10Add the code of the tracking issueLinkTed-36/+36
2020-10-10Replace `assert` with `unreachable`LinkTed-3/+3
2020-10-10Remove unsupported target_os for SocketCredLinkTed-125/+7
2020-10-10Change standard types to libc typesLinkTed-6/+8
2020-10-10Change name of struct to SocketCredLinkTed-9/+9
2020-10-10Change API to unsafe and add doc commentsLinkTed-3/+20
2020-10-10Add `set_passcred` and `passcred` methods to `UnixStream` and `UnixDatagram`LinkTed-11/+121
2020-10-10Rename `test.rs` to `tests.rs`LinkTed-625/+19
2020-10-10Add doc commentsLinkTed-1/+21
2020-10-10Add doc(cfg(...))LinkTed-0/+24
2020-10-10Reduce impl trait by using macro in `raw_fd.rs`LinkTed-61/+34
2020-10-10Move conditional compilation to the upper module and sort the target OS list ↵LinkTed-189/+199
alphabetically
2020-10-10Remove unnecessary pathLinkTed-1/+1
2020-10-10Use `fill` instead of `memset`LinkTed-9/+16
2020-10-10Remove inner function in `bind`, `connect` and `send_to`LinkTed-49/+33
2020-10-10Remove lifetime annotation in `messages` functionLinkTed-1/+1
2020-10-10Remove `Clone` trait bound in `add_to_ancillary_data`LinkTed-1/+1
2020-10-10Add integer overflow checkLinkTed-1/+9