@@ -466,7 +466,7 @@ pub fn socket<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: SockType
466466 }
467467
468468 // TODO: Check the kernel version
469- let res = try!( Errno :: result ( unsafe { ffi :: socket ( domain as c_int , ty, protocol) } ) ) ;
469+ let res = try!( Errno :: result ( unsafe { libc :: socket ( domain as c_int , ty, protocol) } ) ) ;
470470
471471 #[ cfg( any( target_os = "android" ,
472472 target_os = "dragonfly" ,
@@ -509,7 +509,7 @@ pub fn socketpair<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: Sock
509509 }
510510 let mut fds = [ -1 , -1 ] ;
511511 let res = unsafe {
512- ffi :: socketpair ( domain as c_int , ty, protocol, fds. as_mut_ptr ( ) )
512+ libc :: socketpair ( domain as c_int , ty, protocol, fds. as_mut_ptr ( ) )
513513 } ;
514514 try!( Errno :: result ( res) ) ;
515515
@@ -542,7 +542,7 @@ pub fn socketpair<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: Sock
542542///
543543/// [Further reading](http://man7.org/linux/man-pages/man2/listen.2.html)
544544pub fn listen ( sockfd : RawFd , backlog : usize ) -> Result < ( ) > {
545- let res = unsafe { ffi :: listen ( sockfd, backlog as c_int ) } ;
545+ let res = unsafe { libc :: listen ( sockfd, backlog as c_int ) } ;
546546
547547 Errno :: result ( res) . map ( drop)
548548}
@@ -554,7 +554,7 @@ pub fn listen(sockfd: RawFd, backlog: usize) -> Result<()> {
554554pub fn bind ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
555555 let res = unsafe {
556556 let ( ptr, len) = addr. as_ffi_pair ( ) ;
557- ffi :: bind ( fd, ptr, len)
557+ libc :: bind ( fd, ptr, len)
558558 } ;
559559
560560 Errno :: result ( res) . map ( drop)
@@ -569,7 +569,7 @@ pub fn bind(fd: RawFd, addr: &SockAddr) -> Result<()> {
569569pub fn bind ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
570570 let res = unsafe {
571571 let ( ptr, len) = addr. as_ffi_pair ( ) ;
572- ffi :: bind ( fd, ptr, len as c_int )
572+ libc :: bind ( fd, ptr, len as c_int )
573573 } ;
574574
575575 Errno :: result ( res) . map ( drop)
@@ -579,7 +579,7 @@ pub fn bind(fd: RawFd, addr: &SockAddr) -> Result<()> {
579579///
580580/// [Further reading](http://man7.org/linux/man-pages/man2/accept.2.html)
581581pub fn accept ( sockfd : RawFd ) -> Result < RawFd > {
582- let res = unsafe { ffi :: accept ( sockfd, ptr:: null_mut ( ) , ptr:: null_mut ( ) ) } ;
582+ let res = unsafe { libc :: accept ( sockfd, ptr:: null_mut ( ) , ptr:: null_mut ( ) ) } ;
583583
584584 Errno :: result ( res)
585585}
@@ -593,7 +593,7 @@ pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
593593
594594#[ inline]
595595fn accept4_polyfill ( sockfd : RawFd , flags : SockFlag ) -> Result < RawFd > {
596- let res = try!( Errno :: result ( unsafe { ffi :: accept ( sockfd, ptr:: null_mut ( ) , ptr:: null_mut ( ) ) } ) ) ;
596+ let res = try!( Errno :: result ( unsafe { libc :: accept ( sockfd, ptr:: null_mut ( ) , ptr:: null_mut ( ) ) } ) ) ;
597597
598598 #[ cfg( any( target_os = "android" ,
599599 target_os = "dragonfly" ,
@@ -635,7 +635,7 @@ fn accept4_polyfill(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
635635pub fn connect ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
636636 let res = unsafe {
637637 let ( ptr, len) = addr. as_ffi_pair ( ) ;
638- ffi :: connect ( fd, ptr, len)
638+ libc :: connect ( fd, ptr, len)
639639 } ;
640640
641641 Errno :: result ( res) . map ( drop)
@@ -682,7 +682,7 @@ pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) -> Result<(usize, SockAddr)> {
682682pub fn sendto ( fd : RawFd , buf : & [ u8 ] , addr : & SockAddr , flags : MsgFlags ) -> Result < usize > {
683683 let ret = unsafe {
684684 let ( ptr, len) = addr. as_ffi_pair ( ) ;
685- ffi :: sendto ( fd, buf. as_ptr ( ) as * const c_void , buf. len ( ) as size_t , flags. bits ( ) , ptr, len)
685+ libc :: sendto ( fd, buf. as_ptr ( ) as * const c_void , buf. len ( ) as size_t , flags. bits ( ) , ptr, len)
686686 } ;
687687
688688 Errno :: result ( ret) . map ( |r| r as usize )
@@ -693,7 +693,7 @@ pub fn sendto(fd: RawFd, buf: &[u8], addr: &SockAddr, flags: MsgFlags) -> Result
693693/// [Further reading](http://man7.org/linux/man-pages/man2/send.2.html)
694694pub fn send ( fd : RawFd , buf : & [ u8 ] , flags : MsgFlags ) -> Result < usize > {
695695 let ret = unsafe {
696- ffi :: send ( fd, buf. as_ptr ( ) as * const c_void , buf. len ( ) as size_t , flags. bits ( ) )
696+ libc :: send ( fd, buf. as_ptr ( ) as * const c_void , buf. len ( ) as size_t , flags. bits ( ) )
697697 } ;
698698
699699 Errno :: result ( ret) . map ( |r| r as usize )
@@ -775,7 +775,7 @@ pub fn getpeername(fd: RawFd) -> Result<SockAddr> {
775775 let addr: sockaddr_storage = mem:: uninitialized ( ) ;
776776 let mut len = mem:: size_of :: < sockaddr_storage > ( ) as socklen_t ;
777777
778- let ret = ffi :: getpeername ( fd, mem:: transmute ( & addr) , & mut len) ;
778+ let ret = libc :: getpeername ( fd, mem:: transmute ( & addr) , & mut len) ;
779779
780780 try!( Errno :: result ( ret) ) ;
781781
@@ -791,7 +791,7 @@ pub fn getsockname(fd: RawFd) -> Result<SockAddr> {
791791 let addr: sockaddr_storage = mem:: uninitialized ( ) ;
792792 let mut len = mem:: size_of :: < sockaddr_storage > ( ) as socklen_t ;
793793
794- let ret = ffi :: getsockname ( fd, mem:: transmute ( & addr) , & mut len) ;
794+ let ret = libc :: getsockname ( fd, mem:: transmute ( & addr) , & mut len) ;
795795
796796 try!( Errno :: result ( ret) ) ;
797797
0 commit comments