@@ -12,11 +12,11 @@ use crate::buffer::Buffer;
1212use crate :: fd:: OwnedFd ;
1313#[ cfg( not( any( target_os = "espidf" , target_os = "horizon" , target_os = "vita" ) ) ) ]
1414use crate :: fs:: Access ;
15- #[ cfg( not( target_os = "espidf" ) ) ]
15+ #[ cfg( not( any ( target_os = "espidf" , target_os = "redox" ) ) ) ]
1616use crate :: fs:: AtFlags ;
1717#[ cfg( apple) ]
1818use crate :: fs:: CloneFlags ;
19- #[ cfg( any( linux_kernel, apple) ) ]
19+ #[ cfg( any( linux_kernel, apple, target_os = "redox" ) ) ]
2020use crate :: fs:: RenameFlags ;
2121#[ cfg( not( target_os = "espidf" ) ) ]
2222use crate :: fs:: Stat ;
@@ -73,6 +73,7 @@ pub const UTIME_OMIT: Nsecs = backend::c::UTIME_OMIT as Nsecs;
7373///
7474/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/openat.html
7575/// [Linux]: https://man7.org/linux/man-pages/man2/openat.2.html
76+ #[ cfg( not( target_os = "redox" ) ) ]
7677#[ inline]
7778pub fn openat < P : path:: Arg , Fd : AsFd > (
7879 dirfd : Fd ,
@@ -95,7 +96,7 @@ pub fn openat<P: path::Arg, Fd: AsFd>(
9596///
9697/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/readlinkat.html
9798/// [Linux]: https://man7.org/linux/man-pages/man2/readlinkat.2.html
98- #[ cfg( feature = "alloc" ) ]
99+ #[ cfg( all ( feature = "alloc" , not ( target_os = "redox" ) ) ) ]
99100#[ cfg_attr( docsrs, doc( cfg( feature = "alloc" ) ) ) ]
100101#[ inline]
101102pub fn readlinkat < P : path:: Arg , Fd : AsFd , B : Into < Vec < u8 > > > (
@@ -106,7 +107,7 @@ pub fn readlinkat<P: path::Arg, Fd: AsFd, B: Into<Vec<u8>>>(
106107 path. into_with_c_str ( |path| _readlinkat ( dirfd. as_fd ( ) , path, reuse. into ( ) ) )
107108}
108109
109- #[ cfg( feature = "alloc" ) ]
110+ #[ cfg( all ( feature = "alloc" , not ( target_os = "redox" ) ) ) ]
110111#[ allow( unsafe_code) ]
111112fn _readlinkat ( dirfd : BorrowedFd < ' _ > , path : & CStr , mut buffer : Vec < u8 > ) -> io:: Result < CString > {
112113 buffer. clear ( ) ;
@@ -170,6 +171,7 @@ fn _readlinkat(dirfd: BorrowedFd<'_>, path: &CStr, mut buffer: Vec<u8>) -> io::R
170171///
171172/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/readlinkat.html
172173/// [Linux]: https://man7.org/linux/man-pages/man2/readlinkat.2.html
174+ #[ cfg( not( target_os = "redox" ) ) ]
173175#[ inline]
174176pub fn readlinkat_raw < P : path:: Arg , Fd : AsFd , Buf : Buffer < u8 > > (
175177 dirfd : Fd ,
@@ -192,6 +194,7 @@ pub fn readlinkat_raw<P: path::Arg, Fd: AsFd, Buf: Buffer<u8>>(
192194///
193195/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/mkdirat.html
194196/// [Linux]: https://man7.org/linux/man-pages/man2/mkdirat.2.html
197+ #[ cfg( not( target_os = "redox" ) ) ]
195198#[ inline]
196199pub fn mkdirat < P : path:: Arg , Fd : AsFd > ( dirfd : Fd , path : P , mode : Mode ) -> io:: Result < ( ) > {
197200 path. into_with_c_str ( |path| backend:: fs:: syscalls:: mkdirat ( dirfd. as_fd ( ) , path, mode) )
@@ -206,7 +209,7 @@ pub fn mkdirat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, mode: Mode) -> io::Re
206209///
207210/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/linkat.html
208211/// [Linux]: https://man7.org/linux/man-pages/man2/linkat.2.html
209- #[ cfg( not( target_os = "espidf" ) ) ]
212+ #[ cfg( not( any ( target_os = "espidf" , target_os = "redox" ) ) ) ]
210213#[ inline]
211214pub fn linkat < P : path:: Arg , Q : path:: Arg , PFd : AsFd , QFd : AsFd > (
212215 old_dirfd : PFd ,
@@ -240,7 +243,7 @@ pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
240243/// [`REMOVEDIR`]: AtFlags::REMOVEDIR
241244/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/unlinkat.html
242245/// [Linux]: https://man7.org/linux/man-pages/man2/unlinkat.2.html
243- #[ cfg( not( target_os = "espidf" ) ) ]
246+ #[ cfg( not( any ( target_os = "espidf" , target_os = "redox" ) ) ) ]
244247#[ inline]
245248pub fn unlinkat < P : path:: Arg , Fd : AsFd > ( dirfd : Fd , path : P , flags : AtFlags ) -> io:: Result < ( ) > {
246249 path. into_with_c_str ( |path| backend:: fs:: syscalls:: unlinkat ( dirfd. as_fd ( ) , path, flags) )
@@ -286,7 +289,7 @@ pub fn renameat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
286289/// - [Linux]
287290///
288291/// [Linux]: https://man7.org/linux/man-pages/man2/renameat2.2.html
289- #[ cfg( any( apple, linux_kernel) ) ]
292+ #[ cfg( any( apple, linux_kernel, target_os = "redox" ) ) ]
290293#[ inline]
291294#[ doc( alias = "renameat2" ) ]
292295#[ doc( alias = "renameatx_np" ) ]
@@ -318,6 +321,7 @@ pub fn renameat_with<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
318321///
319322/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/symlinkat.html
320323/// [Linux]: https://man7.org/linux/man-pages/man2/symlinkat.2.html
324+ #[ cfg( not( target_os = "redox" ) ) ]
321325#[ inline]
322326pub fn symlinkat < P : path:: Arg , Q : path:: Arg , Fd : AsFd > (
323327 old_path : P ,
@@ -344,7 +348,7 @@ pub fn symlinkat<P: path::Arg, Q: path::Arg, Fd: AsFd>(
344348/// [Linux]: https://man7.org/linux/man-pages/man2/fstatat.2.html
345349/// [`Mode::from_raw_mode`]: crate::fs::Mode::from_raw_mode
346350/// [`FileType::from_raw_mode`]: crate::fs::FileType::from_raw_mode
347- #[ cfg( not( target_os = "espidf" ) ) ]
351+ #[ cfg( not( any ( target_os = "espidf" , target_os = "redox" ) ) ) ]
348352#[ inline]
349353#[ doc( alias = "fstatat" ) ]
350354pub fn statat < P : path:: Arg , Fd : AsFd > ( dirfd : Fd , path : P , flags : AtFlags ) -> io:: Result < Stat > {
@@ -367,7 +371,12 @@ pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io:
367371///
368372/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/faccessat.html
369373/// [Linux]: https://man7.org/linux/man-pages/man2/faccessat.2.html
370- #[ cfg( not( any( target_os = "espidf" , target_os = "horizon" , target_os = "vita" ) ) ) ]
374+ #[ cfg( not( any(
375+ target_os = "espidf" ,
376+ target_os = "horizon" ,
377+ target_os = "vita" ,
378+ target_os = "redox"
379+ ) ) ) ]
371380#[ inline]
372381#[ doc( alias = "faccessat" ) ]
373382pub fn accessat < P : path:: Arg , Fd : AsFd > (
@@ -387,7 +396,12 @@ pub fn accessat<P: path::Arg, Fd: AsFd>(
387396///
388397/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/utimensat.html
389398/// [Linux]: https://man7.org/linux/man-pages/man2/utimensat.2.html
390- #[ cfg( not( any( target_os = "espidf" , target_os = "horizon" , target_os = "vita" ) ) ) ]
399+ #[ cfg( not( any(
400+ target_os = "espidf" ,
401+ target_os = "horizon" ,
402+ target_os = "vita" ,
403+ target_os = "redox"
404+ ) ) ) ]
391405#[ inline]
392406pub fn utimensat < P : path:: Arg , Fd : AsFd > (
393407 dirfd : Fd ,
@@ -410,7 +424,7 @@ pub fn utimensat<P: path::Arg, Fd: AsFd>(
410424///
411425/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fchmodat.html
412426/// [Linux]: https://man7.org/linux/man-pages/man2/fchmodat.2.html
413- #[ cfg( not( any( target_os = "espidf" , target_os = "wasi" ) ) ) ]
427+ #[ cfg( not( any( target_os = "espidf" , target_os = "wasi" , target_os = "redox" ) ) ) ]
414428#[ inline]
415429#[ doc( alias = "fchmodat" ) ]
416430pub fn chmodat < P : path:: Arg , Fd : AsFd > (
@@ -454,7 +468,8 @@ pub fn fclonefileat<Fd: AsFd, DstFd: AsFd, P: path::Arg>(
454468 target_os = "espidf" ,
455469 target_os = "horizon" ,
456470 target_os = "vita" ,
457- target_os = "wasi"
471+ target_os = "wasi" ,
472+ target_os = "redox" ,
458473) ) ) ]
459474#[ inline]
460475pub fn mknodat < P : path:: Arg , Fd : AsFd > (
@@ -480,7 +495,8 @@ pub fn mknodat<P: path::Arg, Fd: AsFd>(
480495 target_os = "espidf" ,
481496 target_os = "horizon" ,
482497 target_os = "vita" ,
483- target_os = "wasi"
498+ target_os = "wasi" ,
499+ target_os = "redox" ,
484500) ) ) ]
485501#[ inline]
486502pub fn mkfifoat < P : path:: Arg , Fd : AsFd > ( dirfd : Fd , path : P , mode : Mode ) -> io:: Result < ( ) > {
@@ -496,7 +512,7 @@ pub fn mkfifoat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, mode: Mode) -> io::R
496512///
497513/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/fchownat.html
498514/// [Linux]: https://man7.org/linux/man-pages/man2/fchownat.2.html
499- #[ cfg( not( any( target_os = "espidf" , target_os = "wasi" ) ) ) ]
515+ #[ cfg( not( any( target_os = "espidf" , target_os = "wasi" , target_os = "redox" ) ) ) ]
500516#[ inline]
501517#[ doc( alias = "fchownat" ) ]
502518pub fn chownat < P : path:: Arg , Fd : AsFd > (
0 commit comments