@@ -1381,6 +1381,15 @@ s_no_extra_traits! {
13811381 pub struct os_unfair_lock_s {
13821382 _os_unfair_lock_opaque: u32 ,
13831383 }
1384+
1385+ #[ cfg_attr( libc_packedN, repr( packed( 1 ) ) ) ]
1386+ pub struct sockaddr_vm {
1387+ pub svm_len: :: c_uchar,
1388+ pub svm_family: :: sa_family_t,
1389+ pub svm_reserved1: :: c_ushort,
1390+ pub svm_port: :: c_uint,
1391+ pub svm_cid: :: c_uint,
1392+ }
13841393}
13851394
13861395impl siginfo_t {
@@ -2683,6 +2692,52 @@ cfg_if! {
26832692 self . _os_unfair_lock_opaque. hash( state) ;
26842693 }
26852694 }
2695+
2696+ impl PartialEq for sockaddr_vm {
2697+ fn eq( & self , other: & sockaddr_vm) -> bool {
2698+ self . svm_len == other. svm_len
2699+ && self . svm_family == other. svm_family
2700+ && self . svm_reserved1 == other. svm_reserved1
2701+ && self . svm_port == other. svm_port
2702+ && self . svm_cid == other. svm_cid
2703+ }
2704+ }
2705+
2706+ impl Eq for sockaddr_vm { }
2707+
2708+ impl :: fmt:: Debug for sockaddr_vm {
2709+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
2710+ let svm_len = self . svm_len;
2711+ let svm_family = self . svm_family;
2712+ let svm_reserved1 = self . svm_reserved1;
2713+ let svm_port = self . svm_port;
2714+ let svm_cid = self . svm_cid;
2715+
2716+ f. debug_struct( "sockaddr_vm" )
2717+ . field( "svm_len" , & svm_len)
2718+ . field( "svm_family" , & svm_family)
2719+ . field( "svm_reserved1" , & svm_reserved1)
2720+ . field( "svm_port" , & svm_port)
2721+ . field( "svm_cid" , & svm_cid)
2722+ . finish( )
2723+ }
2724+ }
2725+
2726+ impl :: hash:: Hash for sockaddr_vm {
2727+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
2728+ let svm_len = self . svm_len;
2729+ let svm_family = self . svm_family;
2730+ let svm_reserved1 = self . svm_reserved1;
2731+ let svm_port = self . svm_port;
2732+ let svm_cid = self . svm_cid;
2733+
2734+ svm_len. hash( state) ;
2735+ svm_family. hash( state) ;
2736+ svm_reserved1. hash( state) ;
2737+ svm_port. hash( state) ;
2738+ svm_cid. hash( state) ;
2739+ }
2740+ }
26862741 }
26872742}
26882743
@@ -3644,6 +3699,9 @@ pub const AF_SYSTEM: ::c_int = 32;
36443699pub const AF_NETBIOS : :: c_int = 33 ;
36453700pub const AF_PPP : :: c_int = 34 ;
36463701pub const pseudo_AF_HDRCMPLT: :: c_int = 35 ;
3702+ pub const AF_IEEE80211 : :: c_int = 37 ;
3703+ pub const AF_UTUN : :: c_int = 38 ;
3704+ pub const AF_VSOCK : :: c_int = 40 ;
36473705pub const AF_SYS_CONTROL : :: c_int = 2 ;
36483706
36493707pub const SYSPROTO_EVENT : :: c_int = 1 ;
@@ -3685,6 +3743,7 @@ pub const PF_NATM: ::c_int = AF_NATM;
36853743pub const PF_SYSTEM : :: c_int = AF_SYSTEM ;
36863744pub const PF_NETBIOS : :: c_int = AF_NETBIOS ;
36873745pub const PF_PPP : :: c_int = AF_PPP ;
3746+ pub const PF_VSOCK : :: c_int = AF_VSOCK ;
36883747
36893748pub const NET_RT_DUMP : :: c_int = 1 ;
36903749pub const NET_RT_FLAGS : :: c_int = 2 ;
@@ -5002,6 +5061,13 @@ pub const SSTOP: u32 = 4;
50025061/// Awaiting collection by parent.
50035062pub const SZOMB : u32 = 5 ;
50045063
5064+ // sys/vsock.h
5065+ pub const VMADDR_CID_ANY : :: c_uint = 0xFFFFFFFF ;
5066+ pub const VMADDR_CID_HYPERVISOR : :: c_uint = 0 ;
5067+ pub const VMADDR_CID_RESERVED : :: c_uint = 1 ;
5068+ pub const VMADDR_CID_HOST : :: c_uint = 2 ;
5069+ pub const VMADDR_PORT_ANY : :: c_uint = 0xFFFFFFFF ;
5070+
50055071cfg_if ! {
50065072 if #[ cfg( libc_const_extern_fn) ] {
50075073 const fn __DARWIN_ALIGN32( p: usize ) -> usize {
0 commit comments