@@ -95,6 +95,10 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
9595        ) ) ) ]  
9696        ' poll:  { 
9797            use  crate :: sys:: os:: errno; 
98+             #[ cfg( not( target_os = "linux" ) ) ]  
99+             use  libc:: open as  open64; 
100+             #[ cfg( target_os = "linux" ) ]  
101+             use  libc:: open64; 
98102            let  pfds:  & mut  [ _ ]  = & mut  [ 
99103                libc:: pollfd  {  fd :  0 ,  events :  0 ,  revents :  0  } , 
100104                libc:: pollfd  {  fd :  1 ,  events :  0 ,  revents :  0  } , 
@@ -116,7 +120,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
116120                if  pfd. revents  &  libc:: POLLNVAL  == 0  { 
117121                    continue ; 
118122                } 
119-                 if  libc :: open ( "/dev/null\0 " . as_ptr ( ) . cast ( ) ,  libc:: O_RDWR ,  0 )  == -1  { 
123+                 if  open64 ( "/dev/null\0 " . as_ptr ( ) . cast ( ) ,  libc:: O_RDWR ,  0 )  == -1  { 
120124                    // If the stream is closed but we failed to reopen it, abort the 
121125                    // process. Otherwise we wouldn't preserve the safety of 
122126                    // operations on the corresponding Rust object Stdin, Stdout, or 
@@ -139,9 +143,13 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
139143        ) ) ) ]  
140144        { 
141145            use  crate :: sys:: os:: errno; 
146+             #[ cfg( not( target_os = "linux" ) ) ]  
147+             use  libc:: open as  open64; 
148+             #[ cfg( target_os = "linux" ) ]  
149+             use  libc:: open64; 
142150            for  fd in  0 ..3  { 
143151                if  libc:: fcntl ( fd,  libc:: F_GETFD )  == -1  && errno ( )  == libc:: EBADF  { 
144-                     if  libc :: open ( "/dev/null\0 " . as_ptr ( ) . cast ( ) ,  libc:: O_RDWR ,  0 )  == -1  { 
152+                     if  open64 ( "/dev/null\0 " . as_ptr ( ) . cast ( ) ,  libc:: O_RDWR ,  0 )  == -1  { 
145153                        // If the stream is closed but we failed to reopen it, abort the 
146154                        // process. Otherwise we wouldn't preserve the safety of 
147155                        // operations on the corresponding Rust object Stdin, Stdout, or 
0 commit comments