Skip to content

Commit da0037c

Browse files
authored
Merge pull request #1913 from qwandor-google/vmaddr
Android: Add VMADDR_ constants.
2 parents 1818abf + 4f40b35 commit da0037c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,9 @@ fn test_android(target: &str) {
15621562
// Needs a newer Android SDK for the definition
15631563
"P_PIDFD" => true,
15641564

1565+
// Requires Linux kernel 5.6
1566+
"VMADDR_CID_LOCAL" => true,
1567+
15651568
_ => false,
15661569
}
15671570
});

src/unix/linux_like/android/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,6 +2129,13 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
21292129
pub const ALG_OP_DECRYPT: ::c_int = 0;
21302130
pub const ALG_OP_ENCRYPT: ::c_int = 1;
21312131

2132+
// uapi/linux/vm_sockets.h
2133+
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
2134+
pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
2135+
pub const VMADDR_CID_LOCAL: ::c_uint = 1;
2136+
pub const VMADDR_CID_HOST: ::c_uint = 2;
2137+
pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF;
2138+
21322139
// uapi/linux/inotify.h
21332140
pub const IN_ACCESS: u32 = 0x0000_0001;
21342141
pub const IN_MODIFY: u32 = 0x0000_0002;

0 commit comments

Comments
 (0)