@@ -366,13 +366,6 @@ s! {
366
366
pub ai_next: * mut addrinfo,
367
367
}
368
368
369
- pub struct sockaddr_nl {
370
- pub nl_family: :: sa_family_t,
371
- nl_pad: :: c_ushort,
372
- pub nl_pid: u32 ,
373
- pub nl_groups: u32
374
- }
375
-
376
369
pub struct sockaddr_ll {
377
370
pub sll_family: :: c_ushort,
378
371
pub sll_protocol: :: c_ushort,
@@ -573,32 +566,6 @@ s! {
573
566
__val: [ :: c_int; 2 ] ,
574
567
}
575
568
576
- // x32 compatibility
577
- // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
578
- pub struct mq_attr {
579
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
580
- pub mq_flags: i64 ,
581
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
582
- pub mq_maxmsg: i64 ,
583
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
584
- pub mq_msgsize: i64 ,
585
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
586
- pub mq_curmsgs: i64 ,
587
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
588
- pad: [ i64 ; 4 ] ,
589
-
590
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
591
- pub mq_flags: :: c_long,
592
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
593
- pub mq_maxmsg: :: c_long,
594
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
595
- pub mq_msgsize: :: c_long,
596
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
597
- pub mq_curmsgs: :: c_long,
598
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
599
- pad: [ :: c_long; 4 ] ,
600
- }
601
-
602
569
pub struct cpu_set_t {
603
570
#[ cfg( all( target_pointer_width = "32" ,
604
571
not( target_arch = "x86_64" ) ) ) ]
@@ -971,6 +938,39 @@ s_no_extra_traits! {
971
938
pub d_type: :: c_uchar,
972
939
pub d_name: [ :: c_char; 256 ] ,
973
940
}
941
+
942
+ // x32 compatibility
943
+ // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
944
+ pub struct mq_attr {
945
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
946
+ pub mq_flags: i64 ,
947
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
948
+ pub mq_maxmsg: i64 ,
949
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
950
+ pub mq_msgsize: i64 ,
951
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
952
+ pub mq_curmsgs: i64 ,
953
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
954
+ pad: [ i64 ; 4 ] ,
955
+
956
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
957
+ pub mq_flags: :: c_long,
958
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
959
+ pub mq_maxmsg: :: c_long,
960
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
961
+ pub mq_msgsize: :: c_long,
962
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
963
+ pub mq_curmsgs: :: c_long,
964
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
965
+ pad: [ :: c_long; 4 ] ,
966
+ }
967
+
968
+ pub struct sockaddr_nl {
969
+ pub nl_family: :: sa_family_t,
970
+ nl_pad: :: c_ushort,
971
+ pub nl_pid: u32 ,
972
+ pub nl_groups: u32
973
+ }
974
974
}
975
975
976
976
cfg_if ! {
@@ -1211,6 +1211,59 @@ cfg_if! {
1211
1211
self . d_name. hash( state) ;
1212
1212
}
1213
1213
}
1214
+
1215
+ impl PartialEq for mq_attr {
1216
+ fn eq( & self , other: & mq_attr) -> bool {
1217
+ self . mq_flags == other. mq_flags &&
1218
+ self . mq_maxmsg == other. mq_maxmsg &&
1219
+ self . mq_msgsize == other. mq_msgsize &&
1220
+ self . mq_curmsgs == other. mq_curmsgs
1221
+ }
1222
+ }
1223
+ impl Eq for mq_attr { }
1224
+ impl :: fmt:: Debug for mq_attr {
1225
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1226
+ f. debug_struct( "mq_attr" )
1227
+ . field( "mq_flags" , & self . mq_flags)
1228
+ . field( "mq_maxmsg" , & self . mq_maxmsg)
1229
+ . field( "mq_msgsize" , & self . mq_msgsize)
1230
+ . field( "mq_curmsgs" , & self . mq_curmsgs)
1231
+ . finish( )
1232
+ }
1233
+ }
1234
+ impl :: hash:: Hash for mq_attr {
1235
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1236
+ self . mq_flags. hash( state) ;
1237
+ self . mq_maxmsg. hash( state) ;
1238
+ self . mq_msgsize. hash( state) ;
1239
+ self . mq_curmsgs. hash( state) ;
1240
+ }
1241
+ }
1242
+
1243
+ impl PartialEq for sockaddr_nl {
1244
+ fn eq( & self , other: & sockaddr_nl) -> bool {
1245
+ self . nl_family == other. nl_family &&
1246
+ self . nl_pid == other. nl_pid &&
1247
+ self . nl_groups == other. nl_groups
1248
+ }
1249
+ }
1250
+ impl Eq for sockaddr_nl { }
1251
+ impl :: fmt:: Debug for sockaddr_nl {
1252
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1253
+ f. debug_struct( "sockaddr_nl" )
1254
+ . field( "nl_family" , & self . nl_family)
1255
+ . field( "nl_pid" , & self . nl_pid)
1256
+ . field( "nl_groups" , & self . nl_groups)
1257
+ . finish( )
1258
+ }
1259
+ }
1260
+ impl :: hash:: Hash for sockaddr_nl {
1261
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1262
+ self . nl_family. hash( state) ;
1263
+ self . nl_pid. hash( state) ;
1264
+ self . nl_groups. hash( state) ;
1265
+ }
1266
+ }
1214
1267
}
1215
1268
}
1216
1269
0 commit comments