@@ -165,7 +165,7 @@ libc_bitflags!{
165
165
/// file descriptor using the `SCM_RIGHTS` operation (described in
166
166
/// [unix(7)](https://linux.die.net/man/7/unix)).
167
167
/// This flag is useful for the same reasons as the `O_CLOEXEC` flag of
168
- /// [open(2)](https ://linux.die.net/man/2/ open).
168
+ /// [open(2)](http ://pubs.opengroup.org/onlinepubs/9699919799/functions/ open.html ).
169
169
///
170
170
/// Only used in [`recvmsg`](fn.recvmsg.html) function.
171
171
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
@@ -548,7 +548,7 @@ pub fn recvmsg<'a, T>(fd: RawFd, iov: &[IoVec<&mut [u8]>], cmsg_buffer: Option<&
548
548
/// protocols may exist, in which case a particular protocol must be
549
549
/// specified in this manner.
550
550
///
551
- /// [Further reading](http://man7. org/linux/man-pages/man2 /socket.2 .html)
551
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /socket.html)
552
552
pub fn socket < T : Into < Option < SockProtocol > > > ( domain : AddressFamily , ty : SockType , flags : SockFlag , protocol : T ) -> Result < RawFd > {
553
553
let mut ty = ty as c_int ;
554
554
let protocol = match protocol. into ( ) {
@@ -590,7 +590,7 @@ pub fn socket<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: SockType
590
590
591
591
/// Create a pair of connected sockets
592
592
///
593
- /// [Further reading](http://man7. org/linux/man-pages/man2 /socketpair.2 .html)
593
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /socketpair.html)
594
594
pub fn socketpair < T : Into < Option < SockProtocol > > > ( domain : AddressFamily , ty : SockType , protocol : T ,
595
595
flags : SockFlag ) -> Result < ( RawFd , RawFd ) > {
596
596
let mut ty = ty as c_int ;
@@ -636,7 +636,7 @@ pub fn socketpair<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: Sock
636
636
637
637
/// Listen for connections on a socket
638
638
///
639
- /// [Further reading](http://man7. org/linux/man-pages/man2 /listen.2 .html)
639
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /listen.html)
640
640
pub fn listen ( sockfd : RawFd , backlog : usize ) -> Result < ( ) > {
641
641
let res = unsafe { libc:: listen ( sockfd, backlog as c_int ) } ;
642
642
@@ -645,7 +645,7 @@ pub fn listen(sockfd: RawFd, backlog: usize) -> Result<()> {
645
645
646
646
/// Bind a name to a socket
647
647
///
648
- /// [Further reading](http://man7. org/linux/man-pages/man2 /bind.2 .html)
648
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /bind.html)
649
649
#[ cfg( not( all( target_os="android" , target_pointer_width="64" ) ) ) ]
650
650
pub fn bind ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
651
651
let res = unsafe {
@@ -673,7 +673,7 @@ pub fn bind(fd: RawFd, addr: &SockAddr) -> Result<()> {
673
673
674
674
/// Accept a connection on a socket
675
675
///
676
- /// [Further reading](http://man7. org/linux/man-pages/man2 /accept.2 .html)
676
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /accept.html)
677
677
pub fn accept ( sockfd : RawFd ) -> Result < RawFd > {
678
678
let res = unsafe { libc:: accept ( sockfd, ptr:: null_mut ( ) , ptr:: null_mut ( ) ) } ;
679
679
@@ -727,7 +727,7 @@ fn accept4_polyfill(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> {
727
727
728
728
/// Initiate a connection on a socket
729
729
///
730
- /// [Further reading](http://man7. org/linux/man-pages/man2 /connect.2 .html)
730
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /connect.html)
731
731
pub fn connect ( fd : RawFd , addr : & SockAddr ) -> Result < ( ) > {
732
732
let res = unsafe {
733
733
let ( ptr, len) = addr. as_ffi_pair ( ) ;
@@ -740,7 +740,7 @@ pub fn connect(fd: RawFd, addr: &SockAddr) -> Result<()> {
740
740
/// Receive data from a connection-oriented socket. Returns the number of
741
741
/// bytes read
742
742
///
743
- /// [Further reading](http://man7. org/linux/man-pages/man2 /recv.2 .html)
743
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /recv.html)
744
744
pub fn recv ( sockfd : RawFd , buf : & mut [ u8 ] , flags : MsgFlags ) -> Result < usize > {
745
745
unsafe {
746
746
let ret = ffi:: recv (
@@ -756,7 +756,7 @@ pub fn recv(sockfd: RawFd, buf: &mut [u8], flags: MsgFlags) -> Result<usize> {
756
756
/// Receive data from a connectionless or connection-oriented socket. Returns
757
757
/// the number of bytes read and the socket address of the sender.
758
758
///
759
- /// [Further reading](http://man7. org/linux/man-pages/man2/recvmsg.2 .html)
759
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions/recvfrom .html)
760
760
pub fn recvfrom ( sockfd : RawFd , buf : & mut [ u8 ] ) -> Result < ( usize , SockAddr ) > {
761
761
unsafe {
762
762
let addr: sockaddr_storage = mem:: zeroed ( ) ;
@@ -775,6 +775,9 @@ pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) -> Result<(usize, SockAddr)> {
775
775
}
776
776
}
777
777
778
+ /// Send a message to a socket
779
+ ///
780
+ /// [Further reading](http://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html)
778
781
pub fn sendto ( fd : RawFd , buf : & [ u8 ] , addr : & SockAddr , flags : MsgFlags ) -> Result < usize > {
779
782
let ret = unsafe {
780
783
let ( ptr, len) = addr. as_ffi_pair ( ) ;
@@ -786,7 +789,7 @@ pub fn sendto(fd: RawFd, buf: &[u8], addr: &SockAddr, flags: MsgFlags) -> Result
786
789
787
790
/// Send data to a connection-oriented socket. Returns the number of bytes read
788
791
///
789
- /// [Further reading](http://man7. org/linux/man-pages/man2 /send.2 .html)
792
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /send.html)
790
793
pub fn send ( fd : RawFd , buf : & [ u8 ] , flags : MsgFlags ) -> Result < usize > {
791
794
let ret = unsafe {
792
795
libc:: send ( fd, buf. as_ptr ( ) as * const c_void , buf. len ( ) as size_t , flags. bits ( ) )
@@ -819,7 +822,7 @@ pub struct ucred {
819
822
/// The protocol level at which to get / set socket options. Used as an
820
823
/// argument to `getsockopt` and `setsockopt`.
821
824
///
822
- /// [Further reading](http://man7. org/linux/man-pages/man2 /setsockopt.2 .html)
825
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /setsockopt.html)
823
826
#[ repr( i32 ) ]
824
827
pub enum SockLevel {
825
828
Socket = libc:: SOL_SOCKET ,
@@ -851,21 +854,21 @@ pub trait SetSockOpt : Copy {
851
854
852
855
/// Get the current value for the requested socket option
853
856
///
854
- /// [Further reading](http://man7. org/linux/man-pages/man2 /getsockopt.2 .html)
857
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /getsockopt.html)
855
858
pub fn getsockopt < O : GetSockOpt > ( fd : RawFd , opt : O ) -> Result < O :: Val > {
856
859
opt. get ( fd)
857
860
}
858
861
859
862
/// Sets the value for the requested socket option
860
863
///
861
- /// [Further reading](http://man7. org/linux/man-pages/man2 /setsockopt.2 .html)
864
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /setsockopt.html)
862
865
pub fn setsockopt < O : SetSockOpt > ( fd : RawFd , opt : O , val : & O :: Val ) -> Result < ( ) > {
863
866
opt. set ( fd, val)
864
867
}
865
868
866
869
/// Get the address of the peer connected to the socket `fd`.
867
870
///
868
- /// [Further reading](http://man7. org/linux/man-pages/man2 /getpeername.2 .html)
871
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /getpeername.html)
869
872
pub fn getpeername ( fd : RawFd ) -> Result < SockAddr > {
870
873
unsafe {
871
874
let addr: sockaddr_storage = mem:: uninitialized ( ) ;
@@ -881,7 +884,7 @@ pub fn getpeername(fd: RawFd) -> Result<SockAddr> {
881
884
882
885
/// Get the current address to which the socket `fd` is bound.
883
886
///
884
- /// [Further reading](http://man7. org/linux/man-pages/man2 /getsockname.2 .html)
887
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /getsockname.html)
885
888
pub fn getsockname ( fd : RawFd ) -> Result < SockAddr > {
886
889
unsafe {
887
890
let addr: sockaddr_storage = mem:: uninitialized ( ) ;
@@ -946,7 +949,7 @@ pub enum Shutdown {
946
949
947
950
/// Shut down part of a full-duplex connection.
948
951
///
949
- /// [Further reading](http://man7. org/linux/man-pages/man2 /shutdown.2 .html)
952
+ /// [Further reading](http://pubs.opengroup. org/onlinepubs/9699919799/functions /shutdown.html)
950
953
pub fn shutdown ( df : RawFd , how : Shutdown ) -> Result < ( ) > {
951
954
unsafe {
952
955
use libc:: shutdown;
0 commit comments