Skip to content

Commit 4779ad5

Browse files
devnexenAndy-Python-Programmer
authored andcommitted
linux's sockaddr_vm update for kernel >= 5.11.
close rust-lang#3460
1 parent b53914c commit 4779ad5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libc-test/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4383,6 +4383,8 @@ fn test_linux(target: &str) {
43834383
// Linux >= 5.11 tweaked the `svm_zero` field of the `sockaddr_vm` struct.
43844384
// https://github.com/torvalds/linux/commit/dc8eeef73b63ed8988224ba6b5ed19a615163a7f
43854385
(struct_ == "sockaddr_vm" && field == "svm_zero") ||
4386+
// Linux >= 5.11 had added the svm_flags field to the `sockaddr_vm` struct.
4387+
(struct_ == "sockaddr_vm" && field == "svm_flags") ||
43864388
// the `ifr_ifru` field is an anonymous union
43874389
(struct_ == "ifreq" && field == "ifr_ifru") ||
43884390
// the `ifc_ifcu` field is an anonymous union

src/unix/linux_like/linux/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ s! {
489489
pub svm_reserved1: ::c_ushort,
490490
pub svm_port: ::c_uint,
491491
pub svm_cid: ::c_uint,
492-
pub svm_zero: [u8; 4]
492+
pub svm_flags: u8,
493+
pub svm_zero: [u8; 3]
493494
}
494495

495496
pub struct regmatch_t {

0 commit comments

Comments
 (0)