about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-01-01 18:55:10 +0000
committerbors <bors@rust-lang.org>2025-01-01 18:55:10 +0000
commit45d11e51bb66c2deb63a006fe3953c4b6fbc50c2 (patch)
treed634afbd6968ee6d1e4ed8f8107612d8b21b6e26
parent372442fe5ff1a2d06f4119f2b2e7d1e42388a0d3 (diff)
parentb6af0c483672e87a815755beec57f0e30cc4a84f (diff)
downloadrust-45d11e51bb66c2deb63a006fe3953c4b6fbc50c2.tar.gz
rust-45d11e51bb66c2deb63a006fe3953c4b6fbc50c2.zip
Auto merge of #134080 - kleisauke:avoid-lfs64-emscripten, r=Noratrieb
Avoid use of LFS64 symbols on Emscripten

Since Emscripten uses musl libc internally.

Non-functional change: all LFS64 symbols were aliased to their non-LFS64 counterparts in rust-lang/libc@7c952dceaad4cdc35e00884fcb12a713d41a87e0.
-rw-r--r--library/std/src/os/emscripten/fs.rs2
-rw-r--r--library/std/src/os/emscripten/raw.rs2
-rw-r--r--library/std/src/sys/pal/unix/fd.rs2
-rw-r--r--library/std/src/sys/pal/unix/fs.rs14
4 files changed, 3 insertions, 17 deletions
diff --git a/library/std/src/os/emscripten/fs.rs b/library/std/src/os/emscripten/fs.rs
index 3282b79ac1c..81f9ef331a5 100644
--- a/library/std/src/os/emscripten/fs.rs
+++ b/library/std/src/os/emscripten/fs.rs
@@ -63,7 +63,7 @@ pub trait MetadataExt {
 impl MetadataExt for Metadata {
     #[allow(deprecated)]
     fn as_raw_stat(&self) -> &raw::stat {
-        unsafe { &*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat) }
+        unsafe { &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) }
     }
     fn st_dev(&self) -> u64 {
         self.as_inner().as_inner().st_dev as u64
diff --git a/library/std/src/os/emscripten/raw.rs b/library/std/src/os/emscripten/raw.rs
index d23011c7381..7ae8c45a6f8 100644
--- a/library/std/src/os/emscripten/raw.rs
+++ b/library/std/src/os/emscripten/raw.rs
@@ -1,6 +1,4 @@
 //! Emscripten-specific raw type definitions
-//! This is basically exactly the same as the linux definitions,
-//! except using the musl-specific stat64 structure in liblibc.
 
 #![stable(feature = "raw_ext", since = "1.1.0")]
 #![deprecated(
diff --git a/library/std/src/sys/pal/unix/fd.rs b/library/std/src/sys/pal/unix/fd.rs
index 6a28799ca55..2fc33bdfefb 100644
--- a/library/std/src/sys/pal/unix/fd.rs
+++ b/library/std/src/sys/pal/unix/fd.rs
@@ -5,7 +5,6 @@ mod tests;
 
 #[cfg(not(any(
     target_os = "linux",
-    target_os = "emscripten",
     target_os = "l4re",
     target_os = "android",
     target_os = "hurd",
@@ -14,7 +13,6 @@ use libc::off_t as off64_t;
 #[cfg(any(
     target_os = "android",
     target_os = "linux",
-    target_os = "emscripten",
     target_os = "l4re",
     target_os = "hurd",
 ))]
diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs
index 3307fa47c7f..54fa31620ac 100644
--- a/library/std/src/sys/pal/unix/fs.rs
+++ b/library/std/src/sys/pal/unix/fs.rs
@@ -8,16 +8,11 @@ mod tests;
 use libc::c_char;
 #[cfg(any(
     all(target_os = "linux", not(target_env = "musl")),
-    target_os = "emscripten",
     target_os = "android",
     target_os = "hurd"
 ))]
 use libc::dirfd;
-#[cfg(any(
-    all(target_os = "linux", not(target_env = "musl")),
-    target_os = "emscripten",
-    target_os = "hurd"
-))]
+#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
 use libc::fstatat64;
 #[cfg(any(
     target_os = "android",
@@ -34,7 +29,6 @@ use libc::readdir as readdir64;
 #[cfg(not(any(
     target_os = "android",
     target_os = "linux",
-    target_os = "emscripten",
     target_os = "solaris",
     target_os = "illumos",
     target_os = "l4re",
@@ -48,7 +42,7 @@ use libc::readdir as readdir64;
 use libc::readdir_r as readdir64_r;
 #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
 use libc::readdir64;
-#[cfg(any(target_os = "emscripten", target_os = "l4re"))]
+#[cfg(target_os = "l4re")]
 use libc::readdir64_r;
 use libc::{c_int, mode_t};
 #[cfg(target_os = "android")]
@@ -58,7 +52,6 @@ use libc::{
 };
 #[cfg(not(any(
     all(target_os = "linux", not(target_env = "musl")),
-    target_os = "emscripten",
     target_os = "l4re",
     target_os = "android",
     target_os = "hurd",
@@ -69,7 +62,6 @@ use libc::{
 };
 #[cfg(any(
     all(target_os = "linux", not(target_env = "musl")),
-    target_os = "emscripten",
     target_os = "l4re",
     target_os = "hurd"
 ))]
@@ -899,7 +891,6 @@ impl DirEntry {
     #[cfg(all(
         any(
             all(target_os = "linux", not(target_env = "musl")),
-            target_os = "emscripten",
             target_os = "android",
             target_os = "hurd"
         ),
@@ -928,7 +919,6 @@ impl DirEntry {
     #[cfg(any(
         not(any(
             all(target_os = "linux", not(target_env = "musl")),
-            target_os = "emscripten",
             target_os = "android",
             target_os = "hurd",
         )),