Reverts https://github.com/fish-shell/fish-shell/commit/70bd49f61265c3a50c98d439fc77e13ef4409231,
because it causes this compilation failure on Android:

error[E0432]: unresolved import `libc::confstr`
  --> src/env/environment.rs:31:19
   |
31 | use libc::{c_int, confstr, uid_t, STDOUT_FILENO, _IONBF};
   |                   ^^^^^^^ no `confstr` in the root

--- a/src/env/environment.rs
+++ b/src/env/environment.rs
@@ -557,13 +557,14 @@ fn setup_user(vars: &EnvStack) {
 }
 
 pub(crate) static FALLBACK_PATH: Lazy<&[WString]> = Lazy::new(|| {
+    use crate::libc::confstr;
     // _CS_PATH: colon-separated paths to find POSIX utilities. Same as USER_CS_PATH.
     let cs_path = libc::_CS_PATH;
 
-    let buf_size = unsafe { libc::confstr(cs_path, std::ptr::null_mut(), 0) };
+    let buf_size = unsafe { confstr(cs_path, std::ptr::null_mut(), 0) };
     let paths: Vec<WString> = if buf_size > 0 {
         let mut buf = vec![b'\0' as libc::c_char; buf_size];
-        unsafe { libc::confstr(cs_path, buf.as_mut_ptr(), buf_size) };
+        unsafe { confstr(cs_path, buf.as_mut_ptr(), buf_size) };
         let buf = buf;
         // safety: buf should contain a null-byte, and is not mutable unless we move ownership
         let cstr = unsafe { CStr::from_ptr(buf.as_ptr()) };
--- a/src/libc.c
+++ b/src/libc.c
@@ -19,6 +19,21 @@ uint64_t C_ST_LOCAL() {
 #endif
 }
 
+// confstr + _CS_PATH is only available on macOS with rust's libc
+// we could just declare extern "C" confstr directly in Rust
+// that would panic if it failed to link, which C++ did not
+// therefore we define a backup, which just returns an error
+// which for confstr is 0
+#if defined(_CS_PATH)
+#else
+size_t confstr(int name, char* buf, size_t size) {
+    UNUSED(name);
+    UNUSED(buf);
+    UNUSED(size);
+    return 0;
+}
+#endif
+
 const char* C_PATH_BSHELL() { return _PATH_BSHELL; }
 
 FILE* stdout_stream() { return stdout; }
--- a/src/libc.rs
+++ b/src/libc.rs
@@ -1 +1,7 @@
-
+unsafe extern "C" {
+    pub(crate) fn confstr(
+        name: libc::c_int,
+        buf: *mut libc::c_char,
+        len: libc::size_t,
+    ) -> libc::size_t;
+}
