Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added socketpair and pipe2 for Vita target #3366

Merged
merged 1 commit into from Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 11 additions & 18 deletions src/unix/mod.rs
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
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;
}