From e93797a6893cbc072dc2a2908394243b5803efda Mon Sep 17 00:00:00 2001 From: Stefano Garzarella <sgarzare@redhat.com> Date: Mon, 20 Jul 2020 16:15:25 +0200 Subject: [PATCH] linux: add VMADDR_CID_LOCAL In Linux we replaced VMADDR_CID_RESERVED with VMADDR_CID_LOCAL in commit ef343b35d46667668a099655fca4a5b2e43a5dfe. It is available since Linux v5.6, and it can be used to do local communication if supported. This patch deprecates VMADDR_CID_RESERVED for backward compatibility. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> --- src/unix/linux_like/linux/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 27d5ab22..56e384d6 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -2355,7 +2355,13 @@ pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000; // uapi/linux/vm_sockets.h pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF; pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0; +#[deprecated( + since = "0.2.74", + note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \ + replaced with VMADDR_CID_LOCAL" +)] pub const VMADDR_CID_RESERVED: ::c_uint = 1; +pub const VMADDR_CID_LOCAL: ::c_uint = 1; pub const VMADDR_CID_HOST: ::c_uint = 2; pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF; -- GitLab