Skip to content

Commit

Permalink
Added socketpair and pipe2 to Vita
Browse files Browse the repository at this point in the history
  • Loading branch information
nikarh committed Sep 26, 2023
1 parent 9593176 commit b106649
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
29 changes: 11 additions & 18 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,17 @@ extern "C" {
value: *const ::c_void,
option_len: socklen_t,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "socketpair$UNIX2003"
)]
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")]
pub fn socketpair(
domain: ::c_int,
type_: ::c_int,
protocol: ::c_int,
socket_vector: *mut ::c_int,
) -> ::c_int;
#[cfg(not(all(
libc_cfg_target_vendor,
target_arch = "powerpc",
Expand Down Expand Up @@ -1402,24 +1413,6 @@ extern "C" {

}

cfg_if! {
if #[cfg(not(target_os = "vita"))] {
extern "C" {
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "socketpair$UNIX2003"
)]
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")]
pub fn socketpair(
domain: ::c_int,
type_: ::c_int,
protocol: ::c_int,
socket_vector: *mut ::c_int,
) -> ::c_int;
}
}
}

cfg_if! {
if #[cfg(not(any(target_os = "emscripten",
target_os = "android",
Expand Down
2 changes: 2 additions & 0 deletions src/unix/newlib/vita/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,6 @@ extern "C" {
pub fn pthread_getprocessorid_np() -> ::c_int;

pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;

pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
}

0 comments on commit b106649

Please sign in to comment.