Skip to content

Commit 37357ab

Browse files
committed
Android: Add vsock constants and struct.
1 parent 87d3a32 commit 37357ab

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,7 @@ fn test_android(target: &str) {
14871487
"linux/seccomp.h",
14881488
"linux/sched.h",
14891489
"linux/sockios.h",
1490+
"linux/vm_sockets.h",
14901491
"linux/wait.h",
14911492

14921493
}

src/unix/linux_like/android/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ s! {
236236
pub rm_so: ::ssize_t,
237237
pub rm_eo: ::ssize_t,
238238
}
239+
240+
pub struct sockaddr_vm {
241+
pub svm_family: ::sa_family_t,
242+
pub svm_reserved1: ::c_ushort,
243+
pub svm_port: ::c_uint,
244+
pub svm_cid: ::c_uint,
245+
pub svm_zero: [u8; 4]
246+
}
239247
}
240248

241249
s_no_extra_traits! {
@@ -2241,6 +2249,12 @@ pub const SCHED_DEADLINE: ::c_int = 6;
22412249
pub const SEEK_DATA: ::c_int = 3;
22422250
pub const SEEK_HOLE: ::c_int = 4;
22432251

2252+
// sys/socket.h
2253+
pub const AF_NFC: ::c_int = 39;
2254+
pub const AF_VSOCK: ::c_int = 40;
2255+
pub const PF_NFC: ::c_int = AF_NFC;
2256+
pub const PF_VSOCK: ::c_int = AF_VSOCK;
2257+
22442258
f! {
22452259
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
22462260
cmsg: *const cmsghdr) -> *mut cmsghdr {

0 commit comments

Comments
 (0)