Skip to content

Commit b106649

Browse files
committed
Added socketpair and pipe2 to Vita
1 parent 9593176 commit b106649

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

src/unix/mod.rs

+11-18
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,17 @@ extern "C" {
678678
value: *const ::c_void,
679679
option_len: socklen_t,
680680
) -> ::c_int;
681+
#[cfg_attr(
682+
all(target_os = "macos", target_arch = "x86"),
683+
link_name = "socketpair$UNIX2003"
684+
)]
685+
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")]
686+
pub fn socketpair(
687+
domain: ::c_int,
688+
type_: ::c_int,
689+
protocol: ::c_int,
690+
socket_vector: *mut ::c_int,
691+
) -> ::c_int;
681692
#[cfg(not(all(
682693
libc_cfg_target_vendor,
683694
target_arch = "powerpc",
@@ -1402,24 +1413,6 @@ extern "C" {
14021413

14031414
}
14041415

1405-
cfg_if! {
1406-
if #[cfg(not(target_os = "vita"))] {
1407-
extern "C" {
1408-
#[cfg_attr(
1409-
all(target_os = "macos", target_arch = "x86"),
1410-
link_name = "socketpair$UNIX2003"
1411-
)]
1412-
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")]
1413-
pub fn socketpair(
1414-
domain: ::c_int,
1415-
type_: ::c_int,
1416-
protocol: ::c_int,
1417-
socket_vector: *mut ::c_int,
1418-
) -> ::c_int;
1419-
}
1420-
}
1421-
}
1422-
14231416
cfg_if! {
14241417
if #[cfg(not(any(target_os = "emscripten",
14251418
target_os = "android",

src/unix/newlib/vita/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,6 @@ extern "C" {
229229
pub fn pthread_getprocessorid_np() -> ::c_int;
230230

231231
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
232+
233+
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
232234
}

0 commit comments

Comments
 (0)