Skip to content

Commit 44557c4

Browse files
committed
Auto merge of #2758 - fkm3:master, r=Amanieu
Add misc constants and functions for android These are the main diffs present in the downstream android opensource project repo.
2 parents 13534c3 + 50bdc64 commit 44557c4

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

src/unix/linux_like/android/b32/arm.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ pub const SYS_pwritev2: ::c_long = 393;
501501
pub const SYS_pkey_mprotect: ::c_long = 394;
502502
pub const SYS_pkey_alloc: ::c_long = 395;
503503
pub const SYS_pkey_free: ::c_long = 396;
504+
pub const SYS_io_uring_setup: ::c_long = 425;
505+
pub const SYS_io_uring_enter: ::c_long = 426;
504506

505507
// offsets in mcontext_t.gregs from sys/ucontext.h
506508
pub const REG_R0: ::c_int = 0;

src/unix/linux_like/android/b32/x86/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ pub const SYS_pwritev2: ::c_long = 379;
533533
pub const SYS_pkey_mprotect: ::c_long = 380;
534534
pub const SYS_pkey_alloc: ::c_long = 381;
535535
pub const SYS_pkey_free: ::c_long = 382;
536+
pub const SYS_io_uring_setup: ::c_long = 425;
537+
pub const SYS_io_uring_enter: ::c_long = 426;
536538

537539
// offsets in user_regs_structs, from sys/reg.h
538540
pub const EBX: ::c_int = 0;

src/unix/linux_like/android/b64/aarch64/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ pub const SYS_pwritev2: ::c_long = 287;
374374
pub const SYS_pkey_mprotect: ::c_long = 288;
375375
pub const SYS_pkey_alloc: ::c_long = 289;
376376
pub const SYS_pkey_free: ::c_long = 290;
377+
pub const SYS_io_uring_setup: ::c_long = 425;
378+
pub const SYS_io_uring_enter: ::c_long = 426;
377379
pub const SYS_syscalls: ::c_long = 436;
378380

379381
cfg_if! {

src/unix/linux_like/android/b64/x86_64/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ pub const SYS_pwritev2: ::c_long = 328;
603603
pub const SYS_pkey_mprotect: ::c_long = 329;
604604
pub const SYS_pkey_alloc: ::c_long = 330;
605605
pub const SYS_pkey_free: ::c_long = 331;
606+
pub const SYS_io_uring_setup: ::c_long = 425;
607+
pub const SYS_io_uring_enter: ::c_long = 426;
606608

607609
// offsets in user_regs_structs, from sys/reg.h
608610
pub const R15: ::c_int = 0;

src/unix/linux_like/android/mod.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,9 +2170,20 @@ pub const NFT_TRACETYPE_RULE: ::c_int = 3;
21702170
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
21712171
pub const NFT_NG_RANDOM: ::c_int = 1;
21722172

2173+
// bionic/libc/kernel/uapi/linux/if_tun.h
21732174
pub const IFF_TUN: ::c_int = 0x0001;
21742175
pub const IFF_TAP: ::c_int = 0x0002;
2176+
pub const IFF_NAPI: ::c_int = 0x0010;
2177+
pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
21752178
pub const IFF_NO_PI: ::c_int = 0x1000;
2179+
pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
2180+
pub const IFF_VNET_HDR: ::c_int = 0x4000;
2181+
pub const IFF_TUN_EXCL: ::c_int = 0x8000;
2182+
pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
2183+
pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
2184+
pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
2185+
pub const IFF_PERSIST: ::c_int = 0x0800;
2186+
pub const IFF_NOFILTER: ::c_int = 0x1000;
21762187

21772188
// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
21782189
// from https://android.googlesource.com/
@@ -2486,6 +2497,12 @@ pub const AF_VSOCK: ::c_int = 40;
24862497
pub const PF_NFC: ::c_int = AF_NFC;
24872498
pub const PF_VSOCK: ::c_int = AF_VSOCK;
24882499

2500+
// sys/prctl.h
2501+
pub const PR_SET_PDEATHSIG: ::c_int = 1;
2502+
pub const PR_GET_PDEATHSIG: ::c_int = 2;
2503+
pub const PR_GET_SECUREBITS: ::c_int = 27;
2504+
pub const PR_SET_SECUREBITS: ::c_int = 28;
2505+
24892506
// sys/system_properties.h
24902507
pub const PROP_VALUE_MAX: ::c_int = 92;
24912508
pub const PROP_NAME_MAX: ::c_int = 32;
@@ -2969,6 +2986,10 @@ extern "C" {
29692986

29702987
pub fn gettid() -> ::pid_t;
29712988

2989+
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
2990+
2991+
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
2992+
29722993
pub fn __system_property_set(__name: *const ::c_char, __value: *const ::c_char) -> ::c_int;
29732994
pub fn __system_property_get(__name: *const ::c_char, __value: *mut ::c_char) -> ::c_int;
29742995
pub fn __system_property_find(__name: *const ::c_char) -> *const prop_info;

0 commit comments

Comments
 (0)