@@ -9,9 +9,9 @@ use fcntl::FcntlArg::F_SETFD;
9
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
- use std:: ffi:: { CString , CStr , OsString } ;
12
+ use std:: ffi:: { CStr , OsString } ;
13
13
#[ cfg( not( target_os = "redox" ) ) ]
14
- use std:: ffi:: { OsStr } ;
14
+ use std:: ffi:: { CString , OsStr } ;
15
15
use std:: os:: unix:: ffi:: OsStringExt ;
16
16
#[ cfg( not( target_os = "redox" ) ) ]
17
17
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 )
@@ -1203,6 +1205,7 @@ pub enum LinkatFlags {
1203
1205
///
1204
1206
/// # References
1205
1207
/// See also [linkat(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html)
1208
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support symlinks yet
1206
1209
pub fn linkat < P : ?Sized + NixPath > (
1207
1210
olddirfd : Option < RawFd > ,
1208
1211
oldpath : & P ,
@@ -1325,7 +1328,6 @@ pub fn fsync(fd: RawFd) -> Result<()> {
1325
1328
// TODO: exclude only Apple systems after https://github.com/rust-lang/libc/pull/211
1326
1329
#[ cfg( any( target_os = "linux" ,
1327
1330
target_os = "android" ,
1328
- target_os = "redox" ,
1329
1331
target_os = "emscripten" ) ) ]
1330
1332
#[ inline]
1331
1333
pub fn fdatasync ( fd : RawFd ) -> Result < ( ) > {
@@ -1660,6 +1662,7 @@ pub fn initgroups(user: &CStr, group: Gid) -> Result<()> {
1660
1662
///
1661
1663
/// See also [pause(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html).
1662
1664
#[ inline]
1665
+ #[ cfg( not( target_os = "redox" ) ) ]
1663
1666
pub fn pause ( ) {
1664
1667
unsafe { libc:: pause ( ) } ;
1665
1668
}
@@ -2579,6 +2582,7 @@ pub fn access<P: ?Sized + NixPath>(path: &P, amode: AccessFlags) -> Result<()> {
2579
2582
/// fields are based on the user's locale, which could be non-UTF8, while other fields are
2580
2583
/// guaranteed to conform to [`NAME_REGEX`](https://serverfault.com/a/73101/407341), which only
2581
2584
/// contains ASCII.
2585
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2582
2586
#[ derive( Debug , Clone , PartialEq ) ]
2583
2587
pub struct User {
2584
2588
/// Username
@@ -2607,6 +2611,7 @@ pub struct User {
2607
2611
pub expire : libc:: time_t
2608
2612
}
2609
2613
2614
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2610
2615
impl From < & libc:: passwd > for User {
2611
2616
fn from ( pw : & libc:: passwd ) -> User {
2612
2617
unsafe {
@@ -2630,6 +2635,7 @@ impl From<&libc::passwd> for User {
2630
2635
}
2631
2636
}
2632
2637
2638
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2633
2639
impl User {
2634
2640
fn from_anything < F > ( f : F ) -> Result < Option < Self > >
2635
2641
where
@@ -2707,6 +2713,7 @@ impl User {
2707
2713
}
2708
2714
2709
2715
/// Representation of a Group, based on `libc::group`
2716
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2710
2717
#[ derive( Debug , Clone , PartialEq ) ]
2711
2718
pub struct Group {
2712
2719
/// Group name
@@ -2717,6 +2724,7 @@ pub struct Group {
2717
2724
pub mem : Vec < String >
2718
2725
}
2719
2726
2727
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2720
2728
impl From < & libc:: group > for Group {
2721
2729
fn from ( gr : & libc:: group ) -> Group {
2722
2730
unsafe {
@@ -2729,6 +2737,7 @@ impl From<&libc::group> for Group {
2729
2737
}
2730
2738
}
2731
2739
2740
+ #[ cfg( not( target_os = "redox" ) ) ] // RedoxFS does not support passwd
2732
2741
impl Group {
2733
2742
unsafe fn members ( mem : * mut * mut c_char ) -> Vec < String > {
2734
2743
let mut ret = Vec :: new ( ) ;
0 commit comments