Skip to content

Commit dce0ec0

Browse files
authored
Merge pull request #1828 from stefano-garzarella/vsock-vmaddr-local
2 parents e202742 + 45db822 commit dce0ec0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libc-test/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,6 +2614,12 @@ fn test_linux(target: &str) {
26142614
// We should do so after a while.
26152615
"SOMAXCONN" if gnu => true,
26162616

2617+
// deprecated: not available from Linux kernel 5.6:
2618+
"VMADDR_CID_RESERVED" => true,
2619+
2620+
// Require Linux kernel 5.6:
2621+
"VMADDR_CID_LOCAL" => true,
2622+
26172623
_ => false,
26182624
}
26192625
});

src/unix/linux_like/linux/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,13 @@ pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
23552355
// uapi/linux/vm_sockets.h
23562356
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
23572357
pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
2358+
#[deprecated(
2359+
since = "0.2.74",
2360+
note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \
2361+
replaced with VMADDR_CID_LOCAL"
2362+
)]
23582363
pub const VMADDR_CID_RESERVED: ::c_uint = 1;
2364+
pub const VMADDR_CID_LOCAL: ::c_uint = 1;
23592365
pub const VMADDR_CID_HOST: ::c_uint = 2;
23602366
pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF;
23612367

0 commit comments

Comments
 (0)