@@ -605,35 +605,13 @@ extern {
605
605
#[ cfg_attr( target_os = "netbsd" , link_name = "__opendir30" ) ]
606
606
pub fn opendir ( dirname : * const c_char ) -> * mut :: DIR ;
607
607
608
- #[ cfg_attr( all( target_os = "macos" , target_arch = "x86_64" ) ,
609
- link_name = "fdopendir$INODE64" ) ]
610
- #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
611
- link_name = "fdopendir$INODE64$UNIX2003" ) ]
612
- #[ cfg( not( target_os = "redox" ) ) ]
613
- pub fn fdopendir ( fd : :: c_int ) -> * mut :: DIR ;
614
-
615
608
#[ cfg_attr( target_os = "macos" , link_name = "readdir$INODE64" ) ]
616
609
#[ cfg_attr( target_os = "netbsd" , link_name = "__readdir30" ) ]
617
610
#[ cfg_attr(
618
611
all( target_os = "freebsd" , not( freebsd12) ) ,
619
612
link_name = "readdir@FBSD_1.0"
620
613
) ]
621
614
pub fn readdir ( dirp : * mut :: DIR ) -> * mut :: dirent ;
622
- #[ cfg_attr( target_os = "macos" , link_name = "readdir_r$INODE64" ) ]
623
- #[ cfg_attr( target_os = "netbsd" , link_name = "__readdir_r30" ) ]
624
- #[ cfg_attr(
625
- all( target_os = "freebsd" , not( freebsd12) ) ,
626
- link_name = "readdir_r@FBSD_1.0"
627
- ) ]
628
- /// The 64-bit libc on Solaris and illumos only has readdir_r. If a
629
- /// 32-bit Solaris or illumos target is ever created, it should use
630
- /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos:
631
- /// https://illumos.org/man/3lib/libc
632
- /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
633
- /// https://www.unix.com/man-page/opensolaris/3LIB/libc/
634
- #[ cfg( not( target_os = "redox" ) ) ]
635
- pub fn readdir_r ( dirp : * mut :: DIR , entry : * mut :: dirent ,
636
- result : * mut * mut :: dirent ) -> :: c_int ;
637
615
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
638
616
link_name = "closedir$UNIX2003" ) ]
639
617
pub fn closedir ( dirp : * mut :: DIR ) -> :: c_int ;
@@ -643,9 +621,6 @@ extern {
643
621
link_name = "rewinddir$INODE64$UNIX2003" ) ]
644
622
pub fn rewinddir ( dirp : * mut :: DIR ) ;
645
623
646
- #[ cfg( not( target_os = "redox" ) ) ]
647
- pub fn openat ( dirfd : :: c_int , pathname : * const :: c_char ,
648
- flags : :: c_int , ...) -> :: c_int ;
649
624
pub fn fchmodat ( dirfd : :: c_int , pathname : * const :: c_char ,
650
625
mode : :: mode_t , flags : :: c_int ) -> :: c_int ;
651
626
pub fn fchown ( fd : :: c_int ,
@@ -664,12 +639,6 @@ extern {
664
639
pub fn linkat ( olddirfd : :: c_int , oldpath : * const :: c_char ,
665
640
newdirfd : :: c_int , newpath : * const :: c_char ,
666
641
flags : :: c_int ) -> :: c_int ;
667
- #[ cfg( not( target_os = "redox" ) ) ]
668
- pub fn mkdirat ( dirfd : :: c_int , pathname : * const :: c_char ,
669
- mode : :: mode_t ) -> :: c_int ;
670
- #[ cfg( not( target_os = "redox" ) ) ]
671
- pub fn readlinkat ( dirfd : :: c_int , pathname : * const :: c_char ,
672
- buf : * mut :: c_char , bufsiz : :: size_t ) -> :: ssize_t ;
673
642
pub fn renameat ( olddirfd : :: c_int , oldpath : * const :: c_char ,
674
643
newdirfd : :: c_int , newpath : * const :: c_char )
675
644
-> :: c_int ;
@@ -732,8 +701,6 @@ extern {
732
701
pub fn pathconf ( path : * const c_char , name : :: c_int ) -> c_long ;
733
702
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
734
703
link_name = "pause$UNIX2003" ) ]
735
- #[ cfg( not( target_os = "redox" ) ) ]
736
- pub fn pause ( ) -> :: c_int ;
737
704
pub fn pipe ( fds : * mut :: c_int ) -> :: c_int ;
738
705
pub fn posix_memalign ( memptr : * mut * mut :: c_void ,
739
706
align : :: size_t ,
@@ -842,8 +809,6 @@ extern {
842
809
pub fn symlink ( path1 : * const c_char ,
843
810
path2 : * const c_char ) -> :: c_int ;
844
811
845
- #[ cfg( not( target_os = "redox" ) ) ]
846
- pub fn truncate ( path : * const c_char , length : off_t ) -> :: c_int ;
847
812
pub fn ftruncate ( fd : :: c_int , length : off_t ) -> :: c_int ;
848
813
849
814
pub fn signal ( signum : :: c_int , handler : sighandler_t ) -> sighandler_t ;
@@ -1078,9 +1043,6 @@ extern {
1078
1043
#[ cfg_attr( target_os = "netbsd" , link_name = "__timegm50" ) ]
1079
1044
pub fn timegm ( tm : * mut :: tm ) -> time_t ;
1080
1045
1081
- #[ cfg( not( target_os = "redox" ) ) ]
1082
- pub fn getsid ( pid : pid_t ) -> pid_t ;
1083
-
1084
1046
pub fn sysconf ( name : :: c_int ) -> :: c_long ;
1085
1047
1086
1048
pub fn mkfifo ( path : * const c_char , mode : mode_t ) -> :: c_int ;
@@ -1139,6 +1101,46 @@ extern {
1139
1101
stream : * mut FILE ) -> ssize_t ;
1140
1102
}
1141
1103
1104
+ cfg_if ! {
1105
+ if #[ cfg( not( target_os = "redox" ) ) ] {
1106
+ extern {
1107
+ pub fn getsid( pid: pid_t) -> pid_t;
1108
+ pub fn truncate( path: * const c_char, length: off_t) -> :: c_int;
1109
+ pub fn pause( ) -> :: c_int;
1110
+
1111
+ pub fn readlinkat( dirfd: :: c_int,
1112
+ pathname: * const :: c_char,
1113
+ buf: * mut :: c_char,
1114
+ bufsiz: :: size_t) -> :: ssize_t;
1115
+ pub fn mkdirat( dirfd: :: c_int, pathname: * const :: c_char,
1116
+ mode: :: mode_t) -> :: c_int;
1117
+ pub fn openat( dirfd: :: c_int, pathname: * const :: c_char,
1118
+ flags: :: c_int, ...) -> :: c_int;
1119
+
1120
+ #[ cfg_attr( all( target_os = "macos" , target_arch = "x86_64" ) ,
1121
+ link_name = "fdopendir$INODE64" ) ]
1122
+ #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
1123
+ link_name = "fdopendir$INODE64$UNIX2003" ) ]
1124
+ pub fn fdopendir( fd: :: c_int) -> * mut :: DIR ;
1125
+
1126
+ #[ cfg_attr( target_os = "macos" , link_name = "readdir_r$INODE64" ) ]
1127
+ #[ cfg_attr( target_os = "netbsd" , link_name = "__readdir_r30" ) ]
1128
+ #[ cfg_attr(
1129
+ all( target_os = "freebsd" , not( freebsd12) ) ,
1130
+ link_name = "readdir_r@FBSD_1.0"
1131
+ ) ]
1132
+ /// The 64-bit libc on Solaris and illumos only has readdir_r. If a
1133
+ /// 32-bit Solaris or illumos target is ever created, it should use
1134
+ /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos:
1135
+ /// https://illumos.org/man/3lib/libc
1136
+ /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
1137
+ /// https://www.unix.com/man-page/opensolaris/3LIB/libc/
1138
+ pub fn readdir_r( dirp: * mut :: DIR , entry: * mut :: dirent,
1139
+ result: * mut * mut :: dirent) -> :: c_int;
1140
+ }
1141
+ }
1142
+ }
1143
+
1142
1144
cfg_if ! {
1143
1145
if #[ cfg( not( any( target_os = "solaris" , target_os = "illumos" ) ) ) ] {
1144
1146
extern {
0 commit comments