]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/vxworks/net.rs
Rollup merge of #63013 - nivkner:ffi-safe-slice, r=sfackler
[rust.git] / src / libstd / sys / vxworks / net.rs
index 686cea49a6ea8066089a438e17e1b7253f3d3e97..aa6b93c86006933e65dfbd01ce618b64a34df707 100644 (file)
@@ -58,19 +58,6 @@ pub fn new(addr: &SocketAddr, ty: c_int) -> io::Result<Socket> {
 
     pub fn new_raw(fam: c_int, ty: c_int) -> io::Result<Socket> {
         unsafe {
-            // On linux we first attempt to pass the SOCK_CLOEXEC flag to
-            // atomically create the socket and set it as CLOEXEC. Support for
-            // this option, however, was added in 2.6.27, and we still support
-            // 2.6.18 as a kernel, so if the returned error is EINVAL we
-            // fallthrough to the fallback.
-            if cfg!(target_os = "linux") {
-                match cvt(libc::socket(fam, ty | SOCK_CLOEXEC, 0)) {
-                    Ok(fd) => return Ok(Socket(FileDesc::new(fd))),
-                    Err(ref e) if e.raw_os_error() == Some(libc::EINVAL) => {}
-                    Err(e) => return Err(e),
-                }
-            }
-
             let fd = cvt(libc::socket(fam, ty, 0))?;
             let fd = FileDesc::new(fd);
             fd.set_cloexec()?;