@@ -51,6 +51,7 @@ new_flag!(
5151 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
5252 PACKET = libc:: AF_PACKET ,
5353 /// Domain for low-level VSOCK interface.
54+ #[ cfg( not( target_os = "freebsd" ) ) ]
5455 VSOCK = libc:: AF_VSOCK ,
5556 }
5657
@@ -91,12 +92,12 @@ new_flag!(
9192 /// User Datagram Protocol.
9293 UDP = libc:: IPPROTO_UDP ,
9394 /// Datagram Congestion Control Protocol.
94- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
95+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
9596 DCCP = libc:: IPPROTO_DCCP ,
9697 /// Stream Control Transport Protocol.
9798 SCTP = libc:: IPPROTO_SCTP ,
9899 /// UDP-Lite.
99- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
100+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
100101 UDPLITE = libc:: IPPROTO_UDPLITE ,
101102 /// Raw IP packets.
102103 RAW = libc:: IPPROTO_RAW ,
@@ -410,7 +411,7 @@ new_flag!(
410411 pub struct RecvFlag ( u32 ) impl BitOr {
411412 /// Set the close-on-exec flag for the file descriptor received via a
412413 /// UNIX domain file descriptor using the `SCM_RIGHTS` operation.
413- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
414+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
414415 CMSG_CLOEXEC = libc:: MSG_CMSG_CLOEXEC ,
415416 /// This flag specifies that queued errors should be received from the
416417 /// socket error queue.
@@ -538,7 +539,7 @@ new_flag!(
538539 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
539540 DETACH_BPF = libc:: SO_DETACH_BPF ,
540541 /// Domain.
541- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
542+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
542543 DOMAIN = libc:: SO_DOMAIN ,
543544 /// Get and clear the pending socket error.
544545 ERROR = libc:: SO_ERROR ,
@@ -577,7 +578,7 @@ new_flag!(
577578 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
578579 PRIORITY = libc:: SO_PRIORITY ,
579580 /// Retrieves the socket protocol.
580- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
581+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
581582 PROTOCOL = libc:: SO_PROTOCOL ,
582583 /// Maximum receive buffer in bytes.
583584 RECV_BUF = libc:: SO_RCVBUF ,
@@ -678,6 +679,7 @@ new_flag!(
678679 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
679680 PASS_SEC = libc:: IP_PASSSEC ,
680681 /// Collect information about this socket.
682+ #[ cfg( not( target_os = "freebsd" ) ) ]
681683 PKT_INFO = libc:: IP_PKTINFO ,
682684 /// Enable extended reliable error message passing.
683685 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
@@ -687,7 +689,7 @@ new_flag!(
687689 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
688690 RECV_OPTS = libc:: IP_RECVOPTS ,
689691 /// Enables the `IP_ORIGDSTADDR` ancillary message in `recvmsg(2)`.
690- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
692+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
691693 RECV_ORIG_DST_ADDR = libc:: IP_RECVORIGDSTADDR ,
692694 /// Enable passing of `IP_TOS` in ancillary message with incoming
693695 /// packets.
@@ -783,7 +785,7 @@ new_flag!(
783785 #[ doc = man_link!( tcp( 7 ) ) ]
784786 pub struct TcpOpt ( u32 ) {
785787 /// Set the TCP congestion control algorithm to be used.
786- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
788+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
787789 CONGESTION = libc:: TCP_CONGESTION ,
788790 /// Don't send out partial frames.
789791 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
@@ -793,14 +795,14 @@ new_flag!(
793795 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
794796 DEFER_ACCEPT = libc:: TCP_DEFER_ACCEPT ,
795797 /// Collect information about this socket.
796- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
798+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
797799 INFO = libc:: TCP_INFO ,
798800 /// The maximum number of keepalive probes TCP should send before
799801 /// dropping the connection.
800802 KEEP_CNT = libc:: TCP_KEEPCNT ,
801803 /// The time (in seconds) the connection needs to remain idle before TCP
802804 /// starts sending keepalive probes.
803- #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
805+ #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ]
804806 KEEP_IDLE = libc:: TCP_KEEPIDLE ,
805807 /// The time (in seconds) between individual keepalive probes.
806808 KEEP_INTVL = libc:: TCP_KEEPINTVL ,
@@ -1597,7 +1599,7 @@ impl private::SocketAddress for unix::net::SocketAddr {
15971599 fn into_storage ( self ) -> Self :: Storage {
15981600 let mut storage = libc:: sockaddr_un {
15991601 // A number of OS have `sin6_len`, but we don't use it.
1600- #[ cfg( not( any( target_os = "android" , target_os = "linux" ) ) ) ]
1602+ #[ cfg( not( any( target_os = "android" , target_os = "freebsd" , target_os = " linux") ) ) ]
16011603 sun_len : 0 ,
16021604 sun_family : libc:: AF_UNIX as libc:: sa_family_t ,
16031605 // SAFETY: all zero is valid for `sockaddr_un`.
0 commit comments