Skip to content

Commit 0f2b5e7

Browse files
committed
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.
2 parents 93a1995 + 8915f42 commit 0f2b5e7

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,8 @@ extern {
10561056

10571057
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
10581058
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
1059+
1060+
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
10591061
}
10601062

10611063
cfg_if! {

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,8 @@ extern {
11061106
base: ::locale_t) -> ::locale_t;
11071107
#[link_name = "__settimeofday50"]
11081108
pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
1109+
1110+
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
11091111
}
11101112

11111113
#[link(name = "util")]

src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ extern {
263263

264264
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
265265
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
266+
267+
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
266268
}
267269

268270
cfg_if! {

src/unix/solaris/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,4 +1458,6 @@ extern {
14581458
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
14591459
pub fn popen(command: *const c_char,
14601460
mode: *const c_char) -> *mut ::FILE;
1461+
1462+
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
14611463
}

0 commit comments

Comments
 (0)