Skip to content

Commit 45d8d5f

Browse files
authored
Rollup merge of rust-lang#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 7f0a180 + dbe9724 commit 45d8d5f

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-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

+3-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",
@@ -29,12 +24,12 @@ use libc::fstatat64;
2924
target_os = "nto",
3025
target_os = "vita",
3126
all(target_os = "linux", target_env = "musl"),
27+
target_os = "emscripten",
3228
))]
3329
use libc::readdir as readdir64;
3430
#[cfg(not(any(
3531
target_os = "android",
3632
target_os = "linux",
37-
target_os = "emscripten",
3833
target_os = "solaris",
3934
target_os = "illumos",
4035
target_os = "l4re",
@@ -48,7 +43,7 @@ use libc::readdir as readdir64;
4843
use libc::readdir_r as readdir64_r;
4944
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
5045
use libc::readdir64;
51-
#[cfg(any(target_os = "emscripten", target_os = "l4re"))]
46+
#[cfg(target_os = "l4re")]
5247
use libc::readdir64_r;
5348
use libc::{c_int, mode_t};
5449
#[cfg(target_os = "android")]
@@ -58,7 +53,6 @@ use libc::{
5853
};
5954
#[cfg(not(any(
6055
all(target_os = "linux", not(target_env = "musl")),
61-
target_os = "emscripten",
6256
target_os = "l4re",
6357
target_os = "android",
6458
target_os = "hurd",
@@ -69,7 +63,6 @@ use libc::{
6963
};
7064
#[cfg(any(
7165
all(target_os = "linux", not(target_env = "musl")),
72-
target_os = "emscripten",
7366
target_os = "l4re",
7467
target_os = "hurd"
7568
))]
@@ -899,7 +892,6 @@ impl DirEntry {
899892
#[cfg(all(
900893
any(
901894
all(target_os = "linux", not(target_env = "musl")),
902-
target_os = "emscripten",
903895
target_os = "android",
904896
target_os = "hurd"
905897
),
@@ -928,7 +920,6 @@ impl DirEntry {
928920
#[cfg(any(
929921
not(any(
930922
all(target_os = "linux", not(target_env = "musl")),
931-
target_os = "emscripten",
932923
target_os = "android",
933924
target_os = "hurd",
934925
)),

0 commit comments

Comments
 (0)