Skip to content

Commit 45d11e5

Browse files
committed
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@7c952dc.
2 parents 372442f + b6af0c4 commit 45d11e5

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
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-12
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,11 @@ mod tests;
88
use libc::c_char;
99
#[cfg(any(
1010
all(target_os = "linux", not(target_env = "musl")),
11-
target_os = "emscripten",
1211
target_os = "android",
1312
target_os = "hurd"
1413
))]
1514
use libc::dirfd;
16-
#[cfg(any(
17-
all(target_os = "linux", not(target_env = "musl")),
18-
target_os = "emscripten",
19-
target_os = "hurd"
20-
))]
15+
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
2116
use libc::fstatat64;
2217
#[cfg(any(
2318
target_os = "android",
@@ -34,7 +29,6 @@ use libc::readdir as readdir64;
3429
#[cfg(not(any(
3530
target_os = "android",
3631
target_os = "linux",
37-
target_os = "emscripten",
3832
target_os = "solaris",
3933
target_os = "illumos",
4034
target_os = "l4re",
@@ -48,7 +42,7 @@ use libc::readdir as readdir64;
4842
use libc::readdir_r as readdir64_r;
4943
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
5044
use libc::readdir64;
51-
#[cfg(any(target_os = "emscripten", target_os = "l4re"))]
45+
#[cfg(target_os = "l4re")]
5246
use libc::readdir64_r;
5347
use libc::{c_int, mode_t};
5448
#[cfg(target_os = "android")]
@@ -58,7 +52,6 @@ use libc::{
5852
};
5953
#[cfg(not(any(
6054
all(target_os = "linux", not(target_env = "musl")),
61-
target_os = "emscripten",
6255
target_os = "l4re",
6356
target_os = "android",
6457
target_os = "hurd",
@@ -69,7 +62,6 @@ use libc::{
6962
};
7063
#[cfg(any(
7164
all(target_os = "linux", not(target_env = "musl")),
72-
target_os = "emscripten",
7365
target_os = "l4re",
7466
target_os = "hurd"
7567
))]
@@ -899,7 +891,6 @@ impl DirEntry {
899891
#[cfg(all(
900892
any(
901893
all(target_os = "linux", not(target_env = "musl")),
902-
target_os = "emscripten",
903894
target_os = "android",
904895
target_os = "hurd"
905896
),
@@ -928,7 +919,6 @@ impl DirEntry {
928919
#[cfg(any(
929920
not(any(
930921
all(target_os = "linux", not(target_env = "musl")),
931-
target_os = "emscripten",
932922
target_os = "android",
933923
target_os = "hurd",
934924
)),

0 commit comments

Comments
 (0)