Comment out functions not implemented by Redox

This commit is contained in:
Jeremy Soller
2018-09-15 12:31:40 -06:00
parent f661d5d1c0
commit dfb07e473a
14 changed files with 271 additions and 477 deletions
+52 -50
View File
@@ -3,6 +3,58 @@ use super::super::PalSocket;
use super::{e, Sys};
use header::sys_socket::{sockaddr, socklen_t};
impl Sys {
fn getsockopt(
socket: c_int,
level: c_int,
option_name: c_int,
option_value: *mut c_void,
option_len: *mut socklen_t,
) -> c_int {
e(unsafe {
syscall!(
GETSOCKOPT,
socket,
level,
option_name,
option_value,
option_len
)
}) as c_int
}
fn listen(socket: c_int, backlog: c_int) -> c_int {
e(unsafe { syscall!(LISTEN, socket, backlog) }) as c_int
}
fn setsockopt(
socket: c_int,
level: c_int,
option_name: c_int,
option_value: *const c_void,
option_len: socklen_t,
) -> c_int {
e(unsafe {
syscall!(
SETSOCKOPT,
socket,
level,
option_name,
option_value,
option_len
)
}) as c_int
}
fn shutdown(socket: c_int, how: c_int) -> c_int {
e(unsafe { syscall!(SHUTDOWN, socket, how) }) as c_int
}
fn socketpair(domain: c_int, kind: c_int, protocol: c_int, socket_vector: *mut c_int) -> c_int {
e(unsafe { syscall!(SOCKETPAIR, domain, kind, protocol, socket_vector) }) as c_int
}
}
impl PalSocket for Sys {
unsafe fn accept(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> c_int {
e(syscall!(ACCEPT, socket, address, address_len)) as c_int
@@ -32,29 +84,6 @@ impl PalSocket for Sys {
e(syscall!(GETSOCKNAME, socket, address, address_len)) as c_int
}
fn getsockopt(
socket: c_int,
level: c_int,
option_name: c_int,
option_value: *mut c_void,
option_len: *mut socklen_t,
) -> c_int {
e(unsafe {
syscall!(
GETSOCKOPT,
socket,
level,
option_name,
option_value,
option_len
)
}) as c_int
}
fn listen(socket: c_int, backlog: c_int) -> c_int {
e(unsafe { syscall!(LISTEN, socket, backlog) }) as c_int
}
unsafe fn recvfrom(
socket: c_int,
buf: *mut c_void,
@@ -87,34 +116,7 @@ impl PalSocket for Sys {
)) as ssize_t
}
fn setsockopt(
socket: c_int,
level: c_int,
option_name: c_int,
option_value: *const c_void,
option_len: socklen_t,
) -> c_int {
e(unsafe {
syscall!(
SETSOCKOPT,
socket,
level,
option_name,
option_value,
option_len
)
}) as c_int
}
fn shutdown(socket: c_int, how: c_int) -> c_int {
e(unsafe { syscall!(SHUTDOWN, socket, how) }) as c_int
}
unsafe fn socket(domain: c_int, kind: c_int, protocol: c_int) -> c_int {
e(syscall!(SOCKET, domain, kind, protocol)) as c_int
}
fn socketpair(domain: c_int, kind: c_int, protocol: c_int, socket_vector: *mut c_int) -> c_int {
e(unsafe { syscall!(SOCKETPAIR, domain, kind, protocol, socket_vector) }) as c_int
}
}