mirror of
https://github.com/termux/termux-packages.git
synced 2025-05-09 21:35:36 +00:00
- build ctermid
- add custom libc crate patch for 32bit android builds
- avoid using POSIX_SPAWN for spawning processes
- backport FindRust.cmake rustup fix
This backports: b38551dde9
Co-authored-by: Jia Yuan Lo <jylo06g@gmail.com>
Co-authored-by: Yaksh Bariya <yakshbari4@gmail.com>
Co-authored-by: Robert Kirkman <misternumberone@live.com>
Co-authored-by: AminurAlam <64137875+AminurAlam@users.noreply.github.com>
96 lines
3.5 KiB
Diff
96 lines
3.5 KiB
Diff
--- a/src/unix/linux_like/android/mod.rs
|
|
+++ b/src/unix/linux_like/android/mod.rs
|
|
@@ -54,6 +54,92 @@
|
|
pub type posix_spawn_file_actions_t = *mut c_void;
|
|
pub type posix_spawnattr_t = *mut c_void;
|
|
|
|
+pub const POSIX_SPAWN_USEVFORK: c_int = 64;
|
|
+pub const POSIX_SPAWN_SETSID: c_int = 128;
|
|
+
|
|
+pub const POSIX_SPAWN_RESETIDS: c_int = 0x01;
|
|
+pub const POSIX_SPAWN_SETPGROUP: c_int = 0x02;
|
|
+pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x04;
|
|
+pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x08;
|
|
+pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x10;
|
|
+pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x20;
|
|
+
|
|
+extern "C" {
|
|
+ pub fn posix_spawn(
|
|
+ pid: *mut crate::pid_t,
|
|
+ path: *const c_char,
|
|
+ file_actions: *const crate::posix_spawn_file_actions_t,
|
|
+ attrp: *const crate::posix_spawnattr_t,
|
|
+ argv: *const *mut c_char,
|
|
+ envp: *const *mut c_char,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnp(
|
|
+ pid: *mut crate::pid_t,
|
|
+ file: *const c_char,
|
|
+ file_actions: *const crate::posix_spawn_file_actions_t,
|
|
+ attrp: *const crate::posix_spawnattr_t,
|
|
+ argv: *const *mut c_char,
|
|
+ envp: *const *mut c_char,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int;
|
|
+ pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int;
|
|
+ pub fn posix_spawnattr_getsigdefault(
|
|
+ attr: *const posix_spawnattr_t,
|
|
+ default: *mut crate::sigset_t,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_setsigdefault(
|
|
+ attr: *mut posix_spawnattr_t,
|
|
+ default: *const crate::sigset_t,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_getsigmask(
|
|
+ attr: *const posix_spawnattr_t,
|
|
+ default: *mut crate::sigset_t,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_setsigmask(
|
|
+ attr: *mut posix_spawnattr_t,
|
|
+ default: *const crate::sigset_t,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int;
|
|
+ pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int;
|
|
+ pub fn posix_spawnattr_getpgroup(
|
|
+ attr: *const posix_spawnattr_t,
|
|
+ flags: *mut crate::pid_t,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int;
|
|
+ pub fn posix_spawnattr_getschedpolicy(
|
|
+ attr: *const posix_spawnattr_t,
|
|
+ flags: *mut c_int,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int;
|
|
+ pub fn posix_spawnattr_getschedparam(
|
|
+ attr: *const posix_spawnattr_t,
|
|
+ param: *mut crate::sched_param,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawnattr_setschedparam(
|
|
+ attr: *mut posix_spawnattr_t,
|
|
+ param: *const crate::sched_param,
|
|
+ ) -> c_int;
|
|
+
|
|
+ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int;
|
|
+ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int;
|
|
+ pub fn posix_spawn_file_actions_addopen(
|
|
+ actions: *mut posix_spawn_file_actions_t,
|
|
+ fd: c_int,
|
|
+ path: *const c_char,
|
|
+ oflag: c_int,
|
|
+ mode: crate::mode_t,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawn_file_actions_addclose(
|
|
+ actions: *mut posix_spawn_file_actions_t,
|
|
+ fd: c_int,
|
|
+ ) -> c_int;
|
|
+ pub fn posix_spawn_file_actions_adddup2(
|
|
+ actions: *mut posix_spawn_file_actions_t,
|
|
+ fd: c_int,
|
|
+ newfd: c_int,
|
|
+ ) -> c_int;
|
|
+}
|
|
+
|
|
s! {
|
|
pub struct stack_t {
|
|
pub ss_sp: *mut c_void,
|