Skip to content

Commit

Permalink
Auto merge of rust-lang#546 - alexander255:master, r=alexcrichton
Browse files Browse the repository at this point in the history
Add support for the `accept4` system call for FreeBSD* & NetBSD*

As outlined in rust-lang#540.

However since support for this system call seems to be committed, but not yet released in NetBSD & BitRig (is BitRig actually still be developed at all, btw?), I'm not sure whether it wouldn't be a better idea to only add OpenBSD support instead?
What's the official policy on this?
  • Loading branch information
bors committed Mar 3, 2017
2 parents 05a2d19 + 23d4059 commit 863fb88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 863fb88

Please sign in to comment.