@@ -605,33 +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
- pub fn fdopendir ( fd : :: c_int ) -> * mut :: DIR ;
613
-
614
608
#[ cfg_attr( target_os = "macos" , link_name = "readdir$INODE64" ) ]
615
609
#[ cfg_attr( target_os = "netbsd" , link_name = "__readdir30" ) ]
616
610
#[ cfg_attr(
617
611
all( target_os = "freebsd" , not( freebsd12) ) ,
618
612
link_name = "readdir@FBSD_1.0"
619
613
) ]
620
614
pub fn readdir ( dirp : * mut :: DIR ) -> * mut :: dirent ;
621
- #[ cfg_attr( target_os = "macos" , link_name = "readdir_r$INODE64" ) ]
622
- #[ cfg_attr( target_os = "netbsd" , link_name = "__readdir_r30" ) ]
623
- #[ cfg_attr(
624
- all( target_os = "freebsd" , not( freebsd12) ) ,
625
- link_name = "readdir_r@FBSD_1.0"
626
- ) ]
627
- /// The 64-bit libc on Solaris and illumos only has readdir_r. If a
628
- /// 32-bit Solaris or illumos target is ever created, it should use
629
- /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos:
630
- /// https://illumos.org/man/3lib/libc
631
- /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
632
- /// https://www.unix.com/man-page/opensolaris/3LIB/libc/
633
- pub fn readdir_r ( dirp : * mut :: DIR , entry : * mut :: dirent ,
634
- result : * mut * mut :: dirent ) -> :: c_int ;
635
615
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
636
616
link_name = "closedir$UNIX2003" ) ]
637
617
pub fn closedir ( dirp : * mut :: DIR ) -> :: c_int ;
@@ -641,8 +621,6 @@ extern {
641
621
link_name = "rewinddir$INODE64$UNIX2003" ) ]
642
622
pub fn rewinddir ( dirp : * mut :: DIR ) ;
643
623
644
- pub fn openat ( dirfd : :: c_int , pathname : * const :: c_char ,
645
- flags : :: c_int , ...) -> :: c_int ;
646
624
pub fn fchmodat ( dirfd : :: c_int , pathname : * const :: c_char ,
647
625
mode : :: mode_t , flags : :: c_int ) -> :: c_int ;
648
626
pub fn fchown ( fd : :: c_int ,
@@ -661,10 +639,6 @@ extern {
661
639
pub fn linkat ( olddirfd : :: c_int , oldpath : * const :: c_char ,
662
640
newdirfd : :: c_int , newpath : * const :: c_char ,
663
641
flags : :: c_int ) -> :: c_int ;
664
- pub fn mkdirat ( dirfd : :: c_int , pathname : * const :: c_char ,
665
- mode : :: mode_t ) -> :: c_int ;
666
- pub fn readlinkat ( dirfd : :: c_int , pathname : * const :: c_char ,
667
- buf : * mut :: c_char , bufsiz : :: size_t ) -> :: ssize_t ;
668
642
pub fn renameat ( olddirfd : :: c_int , oldpath : * const :: c_char ,
669
643
newdirfd : :: c_int , newpath : * const :: c_char )
670
644
-> :: c_int ;
@@ -725,9 +699,6 @@ extern {
725
699
pub fn link ( src : * const c_char , dst : * const c_char ) -> :: c_int ;
726
700
pub fn lseek ( fd : :: c_int , offset : off_t , whence : :: c_int ) -> off_t ;
727
701
pub fn pathconf ( path : * const c_char , name : :: c_int ) -> c_long ;
728
- #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
729
- link_name = "pause$UNIX2003" ) ]
730
- pub fn pause ( ) -> :: c_int ;
731
702
pub fn pipe ( fds : * mut :: c_int ) -> :: c_int ;
732
703
pub fn posix_memalign ( memptr : * mut * mut :: c_void ,
733
704
align : :: size_t ,
@@ -836,7 +807,6 @@ extern {
836
807
pub fn symlink ( path1 : * const c_char ,
837
808
path2 : * const c_char ) -> :: c_int ;
838
809
839
- pub fn truncate ( path : * const c_char , length : off_t ) -> :: c_int ;
840
810
pub fn ftruncate ( fd : :: c_int , length : off_t ) -> :: c_int ;
841
811
842
812
pub fn signal ( signum : :: c_int , handler : sighandler_t ) -> sighandler_t ;
@@ -1071,8 +1041,6 @@ extern {
1071
1041
#[ cfg_attr( target_os = "netbsd" , link_name = "__timegm50" ) ]
1072
1042
pub fn timegm ( tm : * mut :: tm ) -> time_t ;
1073
1043
1074
- pub fn getsid ( pid : pid_t ) -> pid_t ;
1075
-
1076
1044
pub fn sysconf ( name : :: c_int ) -> :: c_long ;
1077
1045
1078
1046
pub fn mkfifo ( path : * const c_char , mode : mode_t ) -> :: c_int ;
@@ -1131,6 +1099,48 @@ extern {
1131
1099
stream : * mut FILE ) -> ssize_t ;
1132
1100
}
1133
1101
1102
+ cfg_if ! {
1103
+ if #[ cfg( not( target_os = "redox" ) ) ] {
1104
+ extern {
1105
+ pub fn getsid( pid: pid_t) -> pid_t;
1106
+ pub fn truncate( path: * const c_char, length: off_t) -> :: c_int;
1107
+ #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
1108
+ link_name = "pause$UNIX2003" ) ]
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
+
1134
1144
cfg_if ! {
1135
1145
if #[ cfg( not( any( target_os = "solaris" , target_os = "illumos" ) ) ) ] {
1136
1146
extern {
0 commit comments