Skip to content

Commit d153046

Browse files
authored
Add O_RSYNC + fallocate on solarish, and fadvise on illumos (#1191)
These functions were added to libc 0.2.161, and are required by some downstream crates.
1 parent 2bdd66a commit d153046

7 files changed

Lines changed: 18 additions & 16 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ once_cell = { version = "1.5.2", optional = true }
3838
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_endian = "little", target_arch = "s390x"), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies]
3939
linux-raw-sys = { version = "0.4.14", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] }
4040
libc_errno = { package = "errno", version = "0.3.8", default-features = false, optional = true }
41-
libc = { version = "0.2.156", default-features = false, optional = true }
41+
libc = { version = "0.2.161", default-features = false, optional = true }
4242

4343
# Dependencies for platforms where only libc is supported:
4444
#
4545
# On all other Unix-family platforms, and under Miri, we always use the libc
4646
# backend, so enable its dependencies unconditionally.
4747
[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", target_arch = "s390x"), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
4848
libc_errno = { package = "errno", version = "0.3.8", default-features = false }
49-
libc = { version = "0.2.156", default-features = false }
49+
libc = { version = "0.2.161", default-features = false }
5050

5151
# Additional dependencies for Linux with the libc backend:
5252
#
@@ -74,7 +74,7 @@ default-features = false
7474

7575
[dev-dependencies]
7676
tempfile = "3.5.0"
77-
libc = "0.2.156"
77+
libc = "0.2.161"
7878
libc_errno = { package = "errno", version = "0.3.8", default-features = false }
7979
serial_test = "2.0.0"
8080
memoffset = "0.9.0"

src/backend/libc/fs/syscalls.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::fs::Access;
1717
#[cfg(not(any(
1818
apple,
1919
netbsdlike,
20-
solarish,
20+
target_os = "solaris",
2121
target_os = "dragonfly",
2222
target_os = "espidf",
2323
target_os = "haiku",
@@ -29,7 +29,6 @@ use crate::fs::Advice;
2929
use crate::fs::AtFlags;
3030
#[cfg(not(any(
3131
netbsdlike,
32-
solarish,
3332
target_os = "dragonfly",
3433
target_os = "espidf",
3534
target_os = "nto",
@@ -1196,7 +1195,7 @@ pub(crate) fn copy_file_range(
11961195
#[cfg(not(any(
11971196
apple,
11981197
netbsdlike,
1199-
solarish,
1198+
target_os = "solaris",
12001199
target_os = "dragonfly",
12011200
target_os = "espidf",
12021201
target_os = "haiku",
@@ -1614,7 +1613,6 @@ fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> {
16141613
#[cfg(not(any(
16151614
apple,
16161615
netbsdlike,
1617-
solarish,
16181616
target_os = "dragonfly",
16191617
target_os = "espidf",
16201618
target_os = "nto",

src/backend/libc/fs/types.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ bitflags! {
270270
#[cfg(any(
271271
linux_kernel,
272272
netbsdlike,
273+
solarish,
273274
target_os = "emscripten",
274275
target_os = "wasi",
275276
))]
@@ -562,7 +563,7 @@ impl FileType {
562563
#[cfg(not(any(
563564
apple,
564565
netbsdlike,
565-
solarish,
566+
target_os = "solaris",
566567
target_os = "dragonfly",
567568
target_os = "espidf",
568569
target_os = "haiku",
@@ -796,7 +797,6 @@ bitflags! {
796797

797798
#[cfg(not(any(
798799
netbsdlike,
799-
solarish,
800800
target_os = "espidf",
801801
target_os = "nto",
802802
target_os = "redox",
@@ -812,6 +812,7 @@ bitflags! {
812812
/// `FALLOC_FL_KEEP_SIZE`
813813
#[cfg(not(any(
814814
bsd,
815+
solarish,
815816
target_os = "aix",
816817
target_os = "haiku",
817818
target_os = "hurd",
@@ -821,6 +822,7 @@ bitflags! {
821822
/// `FALLOC_FL_PUNCH_HOLE`
822823
#[cfg(not(any(
823824
bsd,
825+
solarish,
824826
target_os = "aix",
825827
target_os = "haiku",
826828
target_os = "hurd",
@@ -830,6 +832,7 @@ bitflags! {
830832
/// `FALLOC_FL_NO_HIDE_STALE`
831833
#[cfg(not(any(
832834
bsd,
835+
solarish,
833836
target_os = "aix",
834837
target_os = "emscripten",
835838
target_os = "fuchsia",
@@ -843,6 +846,7 @@ bitflags! {
843846
/// `FALLOC_FL_COLLAPSE_RANGE`
844847
#[cfg(not(any(
845848
bsd,
849+
solarish,
846850
target_os = "aix",
847851
target_os = "haiku",
848852
target_os = "hurd",
@@ -853,6 +857,7 @@ bitflags! {
853857
/// `FALLOC_FL_ZERO_RANGE`
854858
#[cfg(not(any(
855859
bsd,
860+
solarish,
856861
target_os = "aix",
857862
target_os = "haiku",
858863
target_os = "hurd",
@@ -863,6 +868,7 @@ bitflags! {
863868
/// `FALLOC_FL_INSERT_RANGE`
864869
#[cfg(not(any(
865870
bsd,
871+
solarish,
866872
target_os = "aix",
867873
target_os = "haiku",
868874
target_os = "hurd",
@@ -873,6 +879,7 @@ bitflags! {
873879
/// `FALLOC_FL_UNSHARE_RANGE`
874880
#[cfg(not(any(
875881
bsd,
882+
solarish,
876883
target_os = "aix",
877884
target_os = "haiku",
878885
target_os = "hurd",

src/fs/fd.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::{backend, io};
99
use backend::fd::{AsFd, BorrowedFd};
1010
#[cfg(not(any(
1111
netbsdlike,
12-
solarish,
1312
target_os = "dragonfly",
1413
target_os = "espidf",
1514
target_os = "nto",
@@ -241,7 +240,6 @@ pub fn futimens<Fd: AsFd>(fd: Fd, times: &Timestamps) -> io::Result<()> {
241240
/// [Linux `posix_fallocate`]: https://man7.org/linux/man-pages/man3/posix_fallocate.3.html
242241
#[cfg(not(any(
243242
netbsdlike,
244-
solarish,
245243
target_os = "dragonfly",
246244
target_os = "espidf",
247245
target_os = "nto",

src/fs/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod dir;
1515
#[cfg(not(any(
1616
apple,
1717
netbsdlike,
18-
solarish,
18+
target_os = "solaris",
1919
target_os = "dragonfly",
2020
target_os = "espidf",
2121
target_os = "haiku",
@@ -81,7 +81,7 @@ pub use dir::{Dir, DirEntry};
8181
#[cfg(not(any(
8282
apple,
8383
netbsdlike,
84-
solarish,
84+
target_os = "solaris",
8585
target_os = "dragonfly",
8686
target_os = "espidf",
8787
target_os = "haiku",

tests/fs/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn test_file() {
8484
#[cfg(not(any(
8585
apple,
8686
netbsdlike,
87-
solarish,
87+
target_os = "solaris",
8888
target_os = "dragonfly",
8989
target_os = "espidf",
9090
target_os = "haiku",

tests/fs/invalid_offset.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ fn invalid_offset_seek() {
3434

3535
#[cfg(not(any(
3636
netbsdlike,
37-
solarish,
3837
target_os = "dragonfly",
3938
target_os = "nto",
4039
target_os = "redox"
@@ -61,7 +60,7 @@ fn invalid_offset_fallocate() {
6160
#[cfg(not(any(
6261
apple,
6362
netbsdlike,
64-
solarish,
63+
target_os = "solaris",
6564
target_os = "dragonfly",
6665
target_os = "haiku",
6766
target_os = "redox",

0 commit comments

Comments
 (0)