Skip to content

Commit

Permalink
Rollup merge of rust-lang#134080 - kleisauke:avoid-lfs64-emscripten, …
Browse files Browse the repository at this point in the history
…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@7c952dc.
  • Loading branch information
Zalathar authored Jan 1, 2025
2 parents 7f0a180 + dbe9724 commit 45d8d5f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion library/std/src/os/emscripten/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions library/std/src/os/emscripten/raw.rs
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
2 changes: 0 additions & 2 deletions library/std/src/sys/pal/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod tests;

#[cfg(not(any(
target_os = "linux",
target_os = "emscripten",
target_os = "l4re",
target_os = "android",
target_os = "hurd",
Expand All @@ -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",
))]
Expand Down
15 changes: 3 additions & 12 deletions library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -29,12 +24,12 @@ use libc::fstatat64;
target_os = "nto",
target_os = "vita",
all(target_os = "linux", target_env = "musl"),
target_os = "emscripten",
))]
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",
Expand All @@ -48,7 +43,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")]
Expand All @@ -58,7 +53,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",
Expand All @@ -69,7 +63,6 @@ use libc::{
};
#[cfg(any(
all(target_os = "linux", not(target_env = "musl")),
target_os = "emscripten",
target_os = "l4re",
target_os = "hurd"
))]
Expand Down Expand Up @@ -899,7 +892,6 @@ impl DirEntry {
#[cfg(all(
any(
all(target_os = "linux", not(target_env = "musl")),
target_os = "emscripten",
target_os = "android",
target_os = "hurd"
),
Expand Down Expand Up @@ -928,7 +920,6 @@ impl DirEntry {
#[cfg(any(
not(any(
all(target_os = "linux", not(target_env = "musl")),
target_os = "emscripten",
target_os = "android",
target_os = "hurd",
)),
Expand Down

0 comments on commit 45d8d5f

Please sign in to comment.