about summary refs log tree commit diff
path: root/library/std/src/sys/unix/fd.rs
diff options
context:
space:
mode:
authorgit-bruh <e817509a-8ee9-4332-b0ad-3a6bdf9ab63f@aleeas.com>2023-09-19 19:47:50 +0530
committergit-bruh <prathamIN@proton.me>2023-10-29 03:29:27 +0000
commit7a504cc68a56bfaa7855016c81ced9e6b1320fc5 (patch)
treeb7ba19ae075477547d06f36a85808767df96de0d /library/std/src/sys/unix/fd.rs
parent2cad938a8173520f2bc39137b475f136be0aeeda (diff)
downloadrust-7a504cc68a56bfaa7855016c81ced9e6b1320fc5.tar.gz
rust-7a504cc68a56bfaa7855016c81ced9e6b1320fc5.zip
Don't use LFS64 symbols on musl
Simplify #[cfg] blocks

fmt

don't try to use the more appropriate direntry on musl
Diffstat (limited to 'library/std/src/sys/unix/fd.rs')
-rw-r--r--library/std/src/sys/unix/fd.rs24
1 files changed, 20 insertions, 4 deletions
diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/unix/fd.rs
index 6c4f408426a..bf1fb3123c4 100644
--- a/library/std/src/sys/unix/fd.rs
+++ b/library/std/src/sys/unix/fd.rs
@@ -126,9 +126,17 @@ impl FileDesc {
     }
 
     pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
-        #[cfg(not(any(target_os = "linux", target_os = "android", target_os = "hurd")))]
+        #[cfg(not(any(
+            all(target_os = "linux", not(target_env = "musl")),
+            target_os = "android",
+            target_os = "hurd"
+        )))]
         use libc::pread as pread64;
-        #[cfg(any(target_os = "linux", target_os = "android", target_os = "hurd"))]
+        #[cfg(any(
+            all(target_os = "linux", not(target_env = "musl")),
+            target_os = "android",
+            target_os = "hurd"
+        ))]
         use libc::pread64;
 
         unsafe {
@@ -285,9 +293,17 @@ impl FileDesc {
     }
 
     pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
-        #[cfg(not(any(target_os = "linux", target_os = "android", target_os = "hurd")))]
+        #[cfg(not(any(
+            all(target_os = "linux", not(target_env = "musl")),
+            target_os = "android",
+            target_os = "hurd"
+        )))]
         use libc::pwrite as pwrite64;
-        #[cfg(any(target_os = "linux", target_os = "android", target_os = "hurd"))]
+        #[cfg(any(
+            all(target_os = "linux", not(target_env = "musl")),
+            target_os = "android",
+            target_os = "hurd"
+        ))]
         use libc::pwrite64;
 
         unsafe {