@@ -833,9 +833,6 @@ pub(crate) mod module {
833833
834834 unsafe extern "C" {
835835 fn _umask ( mask : i32 ) -> i32 ;
836- fn _dup ( fd : i32 ) -> i32 ;
837- fn _dup2 ( fd : i32 , fd2 : i32 ) -> i32 ;
838- fn _open_osfhandle ( osfhandle : intptr_t , flags : i32 ) -> i32 ;
839836 }
840837
841838 /// Close fd and convert error to PyException (PEP 446 cleanup)
@@ -877,8 +874,8 @@ pub(crate) mod module {
877874 // Convert handles to file descriptors
878875 // O_NOINHERIT = 0x80 (MSVC CRT)
879876 const O_NOINHERIT : i32 = 0x80 ;
880- let read_fd = unsafe { _open_osfhandle ( read_handle, O_NOINHERIT ) } ;
881- let write_fd = unsafe { _open_osfhandle ( write_handle, libc:: O_WRONLY | O_NOINHERIT ) } ;
877+ let read_fd = unsafe { libc :: open_osfhandle ( read_handle, O_NOINHERIT ) } ;
878+ let write_fd = unsafe { libc :: open_osfhandle ( write_handle, libc:: O_WRONLY | O_NOINHERIT ) } ;
882879
883880 if read_fd == -1 || write_fd == -1 {
884881 unsafe {
@@ -964,7 +961,7 @@ pub(crate) mod module {
964961
965962 #[ pyfunction]
966963 fn dup ( fd : i32 , vm : & VirtualMachine ) -> PyResult < i32 > {
967- let fd2 = unsafe { suppress_iph ! ( _dup ( fd) ) } ;
964+ let fd2 = unsafe { suppress_iph ! ( libc :: dup ( fd) ) } ;
968965 if fd2 < 0 {
969966 return Err ( errno_err ( vm) ) ;
970967 }
@@ -987,7 +984,7 @@ pub(crate) mod module {
987984
988985 #[ pyfunction]
989986 fn dup2 ( args : Dup2Args , vm : & VirtualMachine ) -> PyResult < i32 > {
990- let result = unsafe { suppress_iph ! ( _dup2 ( args. fd, args. fd2) ) } ;
987+ let result = unsafe { suppress_iph ! ( libc :: dup2 ( args. fd, args. fd2) ) } ;
991988 if result < 0 {
992989 return Err ( errno_err ( vm) ) ;
993990 }
0 commit comments