diff --git a/libc-test/tests/all.rs b/libc-test/tests/all.rs
index 42a743c4f3d2034080ac10bcb1f9afca31359308..15d31814190b4b55159178dcfd3abedf9ee31527 100644
--- a/libc-test/tests/all.rs
+++ b/libc-test/tests/all.rs
@@ -1,5 +1,7 @@
+#![feature(alloc_system)]
 #![allow(bad_style, unused_imports)]
 
+extern crate alloc_system;
 extern crate libc;
 extern crate libc_test;
 
diff --git a/src/unix/other/bsdlike.rs b/src/unix/other/bsdlike.rs
new file mode 100644
index 0000000000000000000000000000000000000000..2928c2eb1b846e4c008446ff6859c4c430765d14
--- /dev/null
+++ b/src/unix/other/bsdlike.rs
@@ -0,0 +1,22 @@
+extern {
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
+    pub fn sysctl(name: *mut ::c_int,
+                  namelen: ::c_uint,
+                  oldp: *mut ::c_void,
+                  oldlenp: *mut ::size_t,
+                  newp: *mut ::c_void,
+                  newlen: ::size_t)
+                  -> ::c_int;
+    pub fn mincore(addr: *const ::c_void, len: ::size_t,
+                   vec: *mut ::c_char) -> ::c_int;
+    pub fn sysctlbyname(name: *const ::c_char,
+                        oldp: *mut ::c_void,
+                        oldlenp: *mut ::size_t,
+                        newp: *mut ::c_void,
+                        newlen: ::size_t)
+                        -> ::c_int;
+    pub fn sysctlnametomib(name: *const ::c_char,
+                           mibp: *mut ::c_int,
+                           sizep: *mut ::size_t)
+                           -> ::c_int;
+}
diff --git a/src/unix/other.rs b/src/unix/other/mod.rs
similarity index 66%
rename from src/unix/other.rs
rename to src/unix/other/mod.rs
index c073a281d082e9fd00bde6e2a1c1e4a85f62debc..4f2d20ab0ab49c01d0bbfb3c98d984f7558da83b 100644
--- a/src/unix/other.rs
+++ b/src/unix/other/mod.rs
@@ -13,12 +13,6 @@ extern {
     pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
                          -> ::c_int;
 
-    #[cfg(target_os = "macos")]
-    pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...)
-                    -> ::c_int;
-    #[cfg(target_os = "linux")]
-    pub fn shm_open(name: *const ::c_char, oflag: ::c_int,
-                    mode: ::mode_t) -> ::c_int;
     pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
 
     #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
@@ -80,38 +74,10 @@ cfg_if! {
                  target_os = "bitrig",
                  target_os = "netbsd",
                  target_os = "openbsd"))] {
-        extern {
-            pub fn sysctl(name: *mut ::c_int,
-                          namelen: ::c_uint,
-                          oldp: *mut ::c_void,
-                          oldlenp: *mut ::size_t,
-                          newp: *mut ::c_void,
-                          newlen: ::size_t)
-                          -> ::c_int;
-            pub fn mincore(addr: *const ::c_void, len: ::size_t,
-                           vec: *mut ::c_char) -> ::c_int;
-            pub fn sysctlbyname(name: *const ::c_char,
-                                oldp: *mut ::c_void,
-                                oldlenp: *mut ::size_t,
-                                newp: *mut ::c_void,
-                                newlen: ::size_t)
-                                -> ::c_int;
-            pub fn sysctlnametomib(name: *const ::c_char,
-                                   mibp: *mut ::c_int,
-                                   sizep: *mut ::size_t)
-                                   -> ::c_int;
-        }
+        mod bsdlike;
+        pub use self::bsdlike::*;
     } else {
-        extern {
-            pub fn sysctl(name: *mut ::c_int,
-                          namelen: ::c_int,
-                          oldp: *mut ::c_void,
-                          oldlenp: *mut ::size_t,
-                          newp: *mut ::c_void,
-                          newlen: ::size_t)
-                          -> ::c_int;
-            pub fn mincore(addr: *mut ::c_void, len: ::size_t,
-                           vec: *mut ::c_uchar) -> ::c_int;
-        }
+        mod notbsd;
+        pub use self::notbsd::*;
     }
 }
diff --git a/src/unix/other/notbsd.rs b/src/unix/other/notbsd.rs
new file mode 100644
index 0000000000000000000000000000000000000000..f42ea1fe24de1328b0670208ba486a93e149dfb6
--- /dev/null
+++ b/src/unix/other/notbsd.rs
@@ -0,0 +1,14 @@
+extern {
+    pub fn shm_open(name: *const ::c_char, oflag: ::c_int,
+                    mode: ::mode_t) -> ::c_int;
+    #[cfg(not(target_env = "musl"))]
+    pub fn sysctl(name: *mut ::c_int,
+                  namelen: ::c_int,
+                  oldp: *mut ::c_void,
+                  oldlenp: *mut ::size_t,
+                  newp: *mut ::c_void,
+                  newlen: ::size_t)
+                  -> ::c_int;
+    pub fn mincore(addr: *mut ::c_void, len: ::size_t,
+                   vec: *mut ::c_uchar) -> ::c_int;
+}