diff --git a/build.rs b/build.rs
index bbee2d28a1789..e97be1a6ab108 100644
--- a/build.rs
+++ b/build.rs
@@ -83,6 +83,11 @@ fn main() {
         println!("cargo:rustc-cfg=libc_non_exhaustive");
     }
 
+    // Rust >= 1.47 supports long array:
+    if rustc_minor_ver >= 47 || rustc_dep_of_std {
+        println!("cargo:rustc-cfg=libc_long_array");
+    }
+
     if rustc_minor_ver >= 51 || rustc_dep_of_std {
         println!("cargo:rustc-cfg=libc_ptr_addr_of");
     }
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index 3a39b2e9ca20b..afa4c1ba4a0d3 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -266,6 +266,7 @@ CTLFLAG_RD
 CTLFLAG_RW
 CTLFLAG_SECURE
 CTLFLAG_WR
+CTLIOCGINFO
 CTLTYPE
 CTLTYPE_INT
 CTLTYPE_NODE
@@ -1844,6 +1845,7 @@ copyfile
 copyfile_flags_t
 cpu_subtype_t
 cpu_type_t
+ctl_info
 difftime
 dirfd
 disconnectx
diff --git a/src/unix/bsd/apple/long_array.rs b/src/unix/bsd/apple/long_array.rs
new file mode 100644
index 0000000000000..4c56a275ab32a
--- /dev/null
+++ b/src/unix/bsd/apple/long_array.rs
@@ -0,0 +1,8 @@
+s! {
+    pub struct ctl_info {
+        pub ctl_id: u32,
+        pub ctl_name: [::c_char; MAX_KCTL_NAME],
+    }
+}
+
+pub const MAX_KCTL_NAME: usize = 96;
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 6b391893a3bcd..dd4f48dd42ff3 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -3313,6 +3313,8 @@ pub const MINCORE_MODIFIED: ::c_int = 0x4;
 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
 
+pub const CTLIOCGINFO: c_ulong = 0xc0644e03;
+
 //
 // sys/netinet/in.h
 // Protocols (RFC 1700)
@@ -5931,3 +5933,10 @@ cfg_if! {
         // Unknown target_arch
     }
 }
+
+cfg_if! {
+    if #[cfg(libc_long_array)] {
+        mod long_array;
+        pub use self::long_array::*;
+    }
+}