Skip to content

Commit b3b6980

Browse files
fix
fix fix
1 parent 7debf3f commit b3b6980

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libc-test/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4168,6 +4168,8 @@ fn test_linux(target: &str) {
41684168
(struct_ == "ifconf" && field == "ifc_ifcu") ||
41694169
// the `ifr_ifrn` field is an anonymous union
41704170
(struct_ == "iwreq" && field == "ifr_ifrn") ||
4171+
// the `key` field is a zero-sized array
4172+
(struct_ == "iw_encode_ext" && field == "key") ||
41714173
// glibc uses a single array `uregs` instead of individual fields.
41724174
(struct_ == "user_regs" && arm)
41734175
});

src/unix/linux_like/linux/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ s! {
720720
}
721721

722722
// linux/wireless.h
723-
723+
724724
pub struct iw_param {
725725
pub value: __s32,
726726
pub fixed: __u8,
@@ -778,7 +778,7 @@ s! {
778778
pub addr: ::sockaddr,
779779
pub alg: __u16,
780780
pub key_len: __u16,
781-
pub key: [__u8; 0],
781+
pub key: [__u8;0],
782782
}
783783
pub struct iw_mlme {
784784
pub cmd: __u16,
@@ -3223,6 +3223,9 @@ pub const IWEVASSOCREQIE: ::c_ulong = 0x8C07;
32233223
pub const IWEVASSOCRESPIE: ::c_ulong = 0x8C08;
32243224
pub const IWEVPMKIDCAND: ::c_ulong = 0x8C09;
32253225
pub const IWEVFIRST: ::c_ulong = 0x8C00;
3226+
pub fn IW_EVENT_IDX(cmd: ::c_ulong) -> ::c_ulong {
3227+
cmd - IWEVFIRST
3228+
}
32263229

32273230
pub const IW_PRIV_TYPE_MASK: ::c_ulong = 0x7000;
32283231
pub const IW_PRIV_TYPE_NONE: ::c_ulong = 0x0000;

0 commit comments

Comments
 (0)