Skip to content

Commit 08644b7

Browse files
committed
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.
1 parent f6cb952 commit 08644b7

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

library/std/src/os/emscripten/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub trait MetadataExt {
6363
impl MetadataExt for Metadata {
6464
#[allow(deprecated)]
6565
fn as_raw_stat(&self) -> &raw::stat {
66-
unsafe { &*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat) }
66+
unsafe { &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) }
6767
}
6868
fn st_dev(&self) -> u64 {
6969
self.as_inner().as_inner().st_dev as u64

library/std/src/os/emscripten/raw.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//! Emscripten-specific raw type definitions
2-
//! This is basically exactly the same as the linux definitions,
3-
//! except using the musl-specific stat64 structure in liblibc.
42
53
#![stable(feature = "raw_ext", since = "1.1.0")]
64
#![deprecated(

library/std/src/sys/pal/unix/fd.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ mod tests;
55

66
#[cfg(not(any(
77
target_os = "linux",
8-
target_os = "emscripten",
98
target_os = "l4re",
109
target_os = "android",
1110
target_os = "hurd",
@@ -14,7 +13,6 @@ use libc::off_t as off64_t;
1413
#[cfg(any(
1514
target_os = "android",
1615
target_os = "linux",
17-
target_os = "emscripten",
1816
target_os = "l4re",
1917
target_os = "hurd",
2018
))]

library/std/src/sys/pal/unix/fs.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ use libc::fstatat64;
2929
target_os = "nto",
3030
target_os = "vita",
3131
all(target_os = "linux", target_env = "musl"),
32+
target_os = "emscripten",
3233
))]
3334
use libc::readdir as readdir64;
3435
#[cfg(not(any(
3536
target_os = "android",
3637
target_os = "linux",
37-
target_os = "emscripten",
3838
target_os = "solaris",
3939
target_os = "illumos",
4040
target_os = "l4re",
@@ -48,7 +48,7 @@ use libc::readdir as readdir64;
4848
use libc::readdir_r as readdir64_r;
4949
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
5050
use libc::readdir64;
51-
#[cfg(any(target_os = "emscripten", target_os = "l4re"))]
51+
#[cfg(target_os = "l4re")]
5252
use libc::readdir64_r;
5353
use libc::{c_int, mode_t};
5454
#[cfg(target_os = "android")]
@@ -58,7 +58,6 @@ use libc::{
5858
};
5959
#[cfg(not(any(
6060
all(target_os = "linux", not(target_env = "musl")),
61-
target_os = "emscripten",
6261
target_os = "l4re",
6362
target_os = "android",
6463
target_os = "hurd",
@@ -69,7 +68,6 @@ use libc::{
6968
};
7069
#[cfg(any(
7170
all(target_os = "linux", not(target_env = "musl")),
72-
target_os = "emscripten",
7371
target_os = "l4re",
7472
target_os = "hurd"
7573
))]

0 commit comments

Comments
 (0)