Skip to content

Commit ba57d7c

Browse files
committed
linux(musl): deprecate lfs64 bindings
Deprecates all suffixed types and routines. They are equivalent in musl. The target matters not.
1 parent 651a32c commit ba57d7c

17 files changed

Lines changed: 36 additions & 29 deletions

File tree

src/unix/linux_like/linux/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub type dev_t = u64;
1818
pub type socklen_t = u32;
1919
pub type mode_t = u32;
2020
pub type ino64_t = u64;
21+
// FIXME(1.0,deprecate): lfs binding to be removed
2122
pub type off64_t = i64;
2223
pub type blkcnt64_t = i64;
2324
pub type rlim64_t = u64;
@@ -3479,7 +3480,10 @@ extern "C" {
34793480
pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int;
34803481
#[cfg_attr(gnu_file_offset_bits64, link_name = "posix_fallocate64")]
34813482
pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
3483+
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
34823484
pub fn readahead(fd: c_int, offset: off64_t, count: size_t) -> ssize_t;
3485+
#[cfg(any(target_env = "musl", target_env = "ohos"))]
3486+
pub fn readahead(fd: c_int, offset: off_t, count: size_t) -> ssize_t;
34833487
pub fn getxattr(
34843488
path: *const c_char,
34853489
name: *const c_char,
@@ -3567,7 +3571,10 @@ extern "C" {
35673571

35683572
// Not available now on Android
35693573
pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int;
3574+
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
35703575
pub fn sync_file_range(fd: c_int, offset: off64_t, nbytes: off64_t, flags: c_uint) -> c_int;
3576+
#[cfg(any(target_env = "musl", target_env = "ohos"))]
3577+
pub fn sync_file_range(fd: c_int, offset: off_t, nbytes: off_t, flags: c_uint) -> c_int;
35713578

35723579
pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
35733580

src/unix/linux_like/linux/musl/b32/arm/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use crate::prelude::*;
33

44
pub type wchar_t = u32;
55

6-
pub type stat64 = stat;
7-
86
s! {
97
pub struct stat {
108
pub st_dev: crate::dev_t,

src/unix/linux_like/linux/musl/b32/hexagon.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::prelude::*;
22

33
pub type wchar_t = u32;
4-
pub type stat64 = crate::stat;
54

65
s! {
76
pub struct stat {

src/unix/linux_like/linux/musl/b32/mips/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use crate::prelude::*;
33

44
pub type wchar_t = c_int;
55

6-
pub type stat64 = stat;
7-
86
s! {
97
pub struct stat {
108
pub st_dev: crate::dev_t,
@@ -140,6 +138,7 @@ s! {
140138
pub f_spare: [c_ulong; 5],
141139
}
142140

141+
// FIXME(1.0,deprecate): lfs binding to be removed
143142
pub struct statfs64 {
144143
pub f_type: c_ulong,
145144
pub f_bsize: c_ulong,

src/unix/linux_like/linux/musl/b32/powerpc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use crate::prelude::*;
33

44
pub type wchar_t = i32;
55

6-
pub type stat64 = stat;
7-
86
s! {
97
pub struct termios {
108
pub c_iflag: crate::tcflag_t,

src/unix/linux_like/linux/musl/b32/riscv32/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use crate::prelude::*;
55

66
pub type wchar_t = c_int;
77

8-
pub type stat64 = stat;
9-
108
s! {
119
pub struct stat {
1210
pub st_dev: crate::dev_t,

src/unix/linux_like/linux/musl/b32/x86/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use crate::prelude::*;
33

44
pub type wchar_t = i32;
55

6-
pub type stat64 = stat;
7-
86
s! {
97
pub struct stat {
108
pub st_dev: crate::dev_t,

src/unix/linux_like/linux/musl/b64/aarch64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ pub type wchar_t = u32;
55
pub type nlink_t = u32;
66
pub type blksize_t = c_int;
77

8-
pub type stat64 = stat;
9-
108
s! {
119
pub struct stat {
1210
pub st_dev: crate::dev_t,

src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pub type wchar_t = c_int;
88
pub type nlink_t = c_uint;
99
pub type blksize_t = c_int;
1010

11-
pub type stat64 = stat;
12-
1311
s! {
1412
pub struct stat {
1513
pub st_dev: crate::dev_t,

src/unix/linux_like/linux/musl/b64/mips64.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ pub type wchar_t = i32;
55
pub type nlink_t = c_uint;
66
pub type blksize_t = i64;
77

8-
pub type stat64 = stat;
9-
108
s! {
119
pub struct stat {
1210
pub st_dev: crate::dev_t,
@@ -89,6 +87,7 @@ s! {
8987
pub f_spare: [c_ulong; 5],
9088
}
9189

90+
// FIXME(1.0,deprecate): lfs binding to be removed
9291
pub struct statfs64 {
9392
pub f_type: c_ulong,
9493
pub f_bsize: c_ulong,

0 commit comments

Comments
 (0)