@@ -10,9 +10,9 @@ use libc::{self, c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t,
10
10
uid_t, gid_t, mode_t, PATH_MAX } ;
11
11
use std:: { fmt, mem, ptr} ;
12
12
use std:: convert:: Infallible ;
13
- use std:: ffi:: { CString , CStr , OsString } ;
13
+ use std:: ffi:: { CStr , OsString } ;
14
14
#[ cfg( not( target_os = "redox" ) ) ]
15
- use std:: ffi:: OsStr ;
15
+ use std:: ffi:: { CString , OsStr } ;
16
16
use std:: os:: unix:: ffi:: OsStringExt ;
17
17
#[ cfg( not( target_os = "redox" ) ) ]
18
18
use std:: os:: unix:: ffi:: OsStrExt ;
@@ -525,7 +525,9 @@ pub fn mkfifo<P: ?Sized + NixPath>(path: &P, mode: Mode) -> Result<()> {
525
525
/// [mkfifoat(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html).
526
526
// mkfifoat is not implemented in OSX or android
527
527
#[ inline]
528
- #[ cfg( not( any( target_os = "macos" , target_os = "ios" , target_os = "android" ) ) ) ]
528
+ #[ cfg( not( any(
529
+ target_os = "macos" , target_os = "ios" ,
530
+ target_os = "android" , target_os = "redox" ) ) ) ]
529
531
pub fn mkfifoat < P : ?Sized + NixPath > ( dirfd : Option < RawFd > , path : & P , mode : Mode ) -> Result < ( ) > {
530
532
let res = path. with_nix_path ( |cstr| unsafe {
531
533
libc:: mkfifoat ( at_rawfd ( dirfd) , cstr. as_ptr ( ) , mode. bits ( ) as mode_t )
@@ -1205,6 +1207,7 @@ pub enum LinkatFlags {
1205
1207
///
1206
1208
/// # References
1207
1209
/// See also [linkat(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html)
1210
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support symlinks yet
1208
1211
pub fn linkat < P : ?Sized + NixPath > (
1209
1212
olddirfd : Option < RawFd > ,
1210
1213
oldpath : & P ,
@@ -1327,7 +1330,6 @@ pub fn fsync(fd: RawFd) -> Result<()> {
1327
1330
// TODO: exclude only Apple systems after https://github.com/rust-lang/libc/pull/211
1328
1331
#[ cfg( any( target_os = "linux" ,
1329
1332
target_os = "android" ,
1330
- target_os = "redox" ,
1331
1333
target_os = "emscripten" ) ) ]
1332
1334
#[ inline]
1333
1335
pub fn fdatasync ( fd : RawFd ) -> Result < ( ) > {
@@ -1662,6 +1664,7 @@ pub fn initgroups(user: &CStr, group: Gid) -> Result<()> {
1662
1664
///
1663
1665
/// See also [pause(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html).
1664
1666
#[ inline]
1667
+ #[ cfg( not( target_os = "redox" ) ) ]
1665
1668
pub fn pause ( ) {
1666
1669
unsafe { libc:: pause ( ) } ;
1667
1670
}
@@ -2581,6 +2584,7 @@ pub fn access<P: ?Sized + NixPath>(path: &P, amode: AccessFlags) -> Result<()> {
2581
2584
/// fields are based on the user's locale, which could be non-UTF8, while other fields are
2582
2585
/// guaranteed to conform to [`NAME_REGEX`](https://serverfault.com/a/73101/407341), which only
2583
2586
/// contains ASCII.
2587
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2584
2588
#[ derive( Debug , Clone , PartialEq ) ]
2585
2589
pub struct User {
2586
2590
/// Username
@@ -2609,6 +2613,7 @@ pub struct User {
2609
2613
pub expire : libc:: time_t
2610
2614
}
2611
2615
2616
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2612
2617
impl From < & libc:: passwd > for User {
2613
2618
fn from ( pw : & libc:: passwd ) -> User {
2614
2619
unsafe {
@@ -2632,6 +2637,7 @@ impl From<&libc::passwd> for User {
2632
2637
}
2633
2638
}
2634
2639
2640
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2635
2641
impl User {
2636
2642
fn from_anything < F > ( f : F ) -> Result < Option < Self > >
2637
2643
where
@@ -2709,6 +2715,7 @@ impl User {
2709
2715
}
2710
2716
2711
2717
/// Representation of a Group, based on `libc::group`
2718
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2712
2719
#[ derive( Debug , Clone , PartialEq ) ]
2713
2720
pub struct Group {
2714
2721
/// Group name
@@ -2719,6 +2726,7 @@ pub struct Group {
2719
2726
pub mem : Vec < String >
2720
2727
}
2721
2728
2729
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2722
2730
impl From < & libc:: group > for Group {
2723
2731
fn from ( gr : & libc:: group ) -> Group {
2724
2732
unsafe {
@@ -2731,6 +2739,7 @@ impl From<&libc::group> for Group {
2731
2739
}
2732
2740
}
2733
2741
2742
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2734
2743
impl Group {
2735
2744
unsafe fn members ( mem : * mut * mut c_char ) -> Vec < String > {
2736
2745
let mut ret = Vec :: new ( ) ;
0 commit comments