@@ -466,7 +466,7 @@ pub fn socket<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: SockType
466
466
}
467
467
468
468
// 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) } ) ) ;
470
470
471
471
#[ cfg( any( target_os = "android" ,
472
472
target_os = "dragonfly" ,
@@ -509,7 +509,7 @@ pub fn socketpair<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: Sock
509
509
}
510
510
let mut fds = [ -1 , -1 ] ;
511
511
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 ( ) )
513
513
} ;
514
514
try!( Errno :: result ( res) ) ;
515
515
@@ -542,7 +542,7 @@ pub fn socketpair<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: Sock
542
542
///
543
543
/// [Further reading](http://man7.org/linux/man-pages/man2/listen.2.html)
544
544
pub 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 ) } ;
546
546
547
547
Errno :: result ( res) . map ( drop)
548
548
}
@@ -554,7 +554,7 @@ pub fn listen(sockfd: RawFd, backlog: usize) -> Result<()> {
554
554
pub fn bind ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
555
555
let res = unsafe {
556
556
let ( ptr, len) = addr. as_ffi_pair ( ) ;
557
- ffi :: bind ( fd, ptr, len)
557
+ libc :: bind ( fd, ptr, len)
558
558
} ;
559
559
560
560
Errno :: result ( res) . map ( drop)
@@ -569,7 +569,7 @@ pub fn bind(fd: RawFd, addr: &SockAddr) -> Result<()> {
569
569
pub fn bind ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
570
570
let res = unsafe {
571
571
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 )
573
573
} ;
574
574
575
575
Errno :: result ( res) . map ( drop)
@@ -579,7 +579,7 @@ pub fn bind(fd: RawFd, addr: &SockAddr) -> Result<()> {
579
579
///
580
580
/// [Further reading](http://man7.org/linux/man-pages/man2/accept.2.html)
581
581
pub 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 ( ) ) } ;
583
583
584
584
Errno :: result ( res)
585
585
}
@@ -593,7 +593,7 @@ pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
593
593
594
594
#[ inline]
595
595
fn 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 ( ) ) } ) ) ;
597
597
598
598
#[ cfg( any( target_os = "android" ,
599
599
target_os = "dragonfly" ,
@@ -635,7 +635,7 @@ fn accept4_polyfill(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
635
635
pub fn connect ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
636
636
let res = unsafe {
637
637
let ( ptr, len) = addr. as_ffi_pair ( ) ;
638
- ffi :: connect ( fd, ptr, len)
638
+ libc :: connect ( fd, ptr, len)
639
639
} ;
640
640
641
641
Errno :: result ( res) . map ( drop)
@@ -682,7 +682,7 @@ pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) -> Result<(usize, SockAddr)> {
682
682
pub fn sendto ( fd : RawFd , buf : & [ u8 ] , addr : & SockAddr , flags : MsgFlags ) -> Result < usize > {
683
683
let ret = unsafe {
684
684
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)
686
686
} ;
687
687
688
688
Errno :: result ( ret) . map ( |r| r as usize )
@@ -693,7 +693,7 @@ pub fn sendto(fd: RawFd, buf: &[u8], addr: &SockAddr, flags: MsgFlags) -> Result
693
693
/// [Further reading](http://man7.org/linux/man-pages/man2/send.2.html)
694
694
pub fn send ( fd : RawFd , buf : & [ u8 ] , flags : MsgFlags ) -> Result < usize > {
695
695
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 ( ) )
697
697
} ;
698
698
699
699
Errno :: result ( ret) . map ( |r| r as usize )
@@ -775,7 +775,7 @@ pub fn getpeername(fd: RawFd) -> Result<SockAddr> {
775
775
let addr: sockaddr_storage = mem:: uninitialized ( ) ;
776
776
let mut len = mem:: size_of :: < sockaddr_storage > ( ) as socklen_t ;
777
777
778
- let ret = ffi :: getpeername ( fd, mem:: transmute ( & addr) , & mut len) ;
778
+ let ret = libc :: getpeername ( fd, mem:: transmute ( & addr) , & mut len) ;
779
779
780
780
try!( Errno :: result ( ret) ) ;
781
781
@@ -791,7 +791,7 @@ pub fn getsockname(fd: RawFd) -> Result<SockAddr> {
791
791
let addr: sockaddr_storage = mem:: uninitialized ( ) ;
792
792
let mut len = mem:: size_of :: < sockaddr_storage > ( ) as socklen_t ;
793
793
794
- let ret = ffi :: getsockname ( fd, mem:: transmute ( & addr) , & mut len) ;
794
+ let ret = libc :: getsockname ( fd, mem:: transmute ( & addr) , & mut len) ;
795
795
796
796
try!( Errno :: result ( ret) ) ;
797
797
0 commit comments