summaryrefslogtreecommitdiff
path: root/src/sys/socket/mod.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2015-04-03 16:54:12 -0700
committerCarl Lerche <me@carllerche.com>2015-04-06 17:33:17 -0700
commit9e935330dd252d4ec640197a6040df2aaeb583c9 (patch)
tree51b528bf8e36972c69ae004ea04ef8bc65456534 /src/sys/socket/mod.rs
parente5ae756203a036aafed472a3e83af6941f546887 (diff)
downloadnix-9e935330dd252d4ec640197a6040df2aaeb583c9.zip
Get compiling on Rust 1.0 beta
Initially support this by assuming the lowest common denominator. The long term solution is to improve the build system to allow pulling in more specific features that are available on the target system.
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r--src/sys/socket/mod.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index ea5c9916..dce80cee 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -142,37 +142,6 @@ pub fn accept(sockfd: RawFd) -> Result<RawFd> {
/// Accept a connection on a socket
///
/// [Further reading](http://man7.org/linux/man-pages/man2/accept.2.html)
-#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "android")))]
-pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
- use libc::sockaddr;
-
- type F = unsafe extern "C" fn(c_int, *mut sockaddr, *mut socklen_t, c_int) -> c_int;
-
- extern {
- #[linkage = "extern_weak"]
- static accept4: *const ();
- }
-
- if !accept4.is_null() {
- let res = unsafe {
- mem::transmute::<*const (), F>(accept4)(
- sockfd, ptr::null_mut(), ptr::null_mut(), flags.bits)
- };
-
- if res < 0 {
- return Err(Error::Sys(Errno::last()));
- }
-
- Ok(res)
- } else {
- accept4_polyfill(sockfd, flags)
- }
-}
-
-/// Accept a connection on a socket
-///
-/// [Further reading](http://man7.org/linux/man-pages/man2/accept.2.html)
-#[cfg(any(target_os = "macos", target_os = "ios", target_os = "android"))]
pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
accept4_polyfill(sockfd, flags)
}