Skip to content

Commit

Permalink
Merge #1654
Browse files Browse the repository at this point in the history
1654: Add accept4 on DragonFly, Emscripten, Fuchsia, Illumos, and NetBSD. r=rtzoeller a=rtzoeller

Expand accept4 support to more platforms.

Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
  • Loading branch information
bors[bot] and rtzoeller committed Feb 5, 2022
2 parents 2143ffe + 9269056 commit 57f8e62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -39,6 +39,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
(#[1636](https://github.com/nix-rust/nix/pull/1636))
- Added `fspacectl` on FreeBSD
(#[1640](https://github.com/nix-rust/nix/pull/1640))
- Added `accept4` on DragonFly, Emscripten, Fuchsia, Illumos, and NetBSD.
(#[1654](https://github.com/nix-rust/nix/pull/1654))

### Changed

Expand Down
5 changes: 5 additions & 0 deletions src/sys/socket/mod.rs
Expand Up @@ -1794,8 +1794,13 @@ pub fn accept(sockfd: RawFd) -> Result<RawFd> {
target_arch = "x86_64"
)
),
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "illumos",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd"))]
pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
let res = unsafe { libc::accept4(sockfd, ptr::null_mut(), ptr::null_mut(), flags.bits()) };
Expand Down

0 comments on commit 57f8e62

Please sign in to comment.