From 23d4059546f4d007ee8b5d28969729b9614fa89a Mon Sep 17 00:00:00 2001 From: Alexander Schlarb Date: Thu, 2 Mar 2017 23:01:01 +0100 Subject: [PATCH] Add support for the `accept4` system call for FreeBSD* & NetBSD* --- src/unix/bsd/freebsdlike/mod.rs | 2 ++ src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index f9c8dcb6..197ae56d 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -980,6 +980,8 @@ extern { base: ::locale_t) -> ::locale_t; pub fn uselocale(loc: ::locale_t) -> ::locale_t; pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; + pub fn accept4(s: ::c_int, addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int; pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char); pub fn pthread_attr_get_np(tid: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int; diff --git a/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs b/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs index b7fed64e..8b36ee5c 100644 --- a/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs +++ b/src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs @@ -26,3 +26,8 @@ s! { pub int_n_sign_posn: ::c_char, } } + +extern { + pub fn accept4(s: ::c_int, addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int; +}