Auto merge of #1101 - koutheir:master, r=alexcrichton

Added dup3() support on FreeBSD, NetBSD, OpenBSD and Solaris

Added `dup3()` support on FreeBSD, NetBSD, OpenBSD and Solaris.

The `dup3()` API is present in:
- FreeBSD 10.0 an later.
- NetBSD 6.0 and later.
- OpenBSD 5.7 and later.
- Solaris 11.4 and later.
This commit is contained in:
bors 2018-10-20 01:28:37 +00:00
commit 0f2b5e7920
4 changed files with 8 additions and 0 deletions

View file

@ -1056,6 +1056,8 @@ extern {
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
}
cfg_if! {

View file

@ -1106,6 +1106,8 @@ extern {
base: ::locale_t) -> ::locale_t;
#[link_name = "__settimeofday50"]
pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
}
#[link(name = "util")]

View file

@ -263,6 +263,8 @@ extern {
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
}
cfg_if! {

View file

@ -1458,4 +1458,6 @@ extern {
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn popen(command: *const c_char,
mode: *const c_char) -> *mut ::FILE;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
}