Files
RedBear-OS/local/patches/relibc/P3-spawn-setflags-setsigmask.patch
T
vasilito cee25393d8 fix: boot process improvements — dependency cycle, INIT_NOTIFY, probing loop, and log spam fixes
- Fix P15-8-init-cycle-detection.patch: replace visiting+error with seen+silent-skip
  to eliminate 11 false-positive 'dependency cycle detected' errors on shared deps
- Fix P0-daemon-fix-init-notify-unwrap.patch: remove eprintln! for missing
  INIT_NOTIFY (expected for oneshot_async services, ~7 daemons affected)
- Fix driver-manager hotplug loop: add PERMANENTLY_SKIPPED static set shared
  between hotplug handler and DriverConfig::probe() to stop infinite re-probing
  of Fatal/NotSupported/deferred-exhausted device+driver pairs (e.g. ided)
- Fix driver-manager log_timeline: suppress repeated EPIPE/ENOENT errors with
  AtomicI32 dedup and AtomicBool one-shot guards for boot timeline JSON
- Add driver-manager SIGTERM handler, ACPI bus registration, --status mode,
  driver reap loop, graceful shutdown, and reduced deferred retries (30→3)
2026-05-17 12:34:02 +03:00

76 lines
2.0 KiB
Diff

--- a/src/header/spawn/mod.rs
+++ b/src/header/spawn/mod.rs
@@ -4,6 +4,7 @@
error::{Errno, ResultExt},
header::{
errno::EINVAL,
+ bits_sigset_t::sigset_t,
unistd::{execve, fork, _exit},
},
platform::{self, types::{c_char, c_int, c_short, pid_t}},
@@ -26,7 +27,8 @@
pub struct posix_spawnattr_t {
pub flags: c_short,
pub pgroup: pid_t,
- _reserved: [u64; 8],
+ pub sd: sigset_t,
+ _reserved: [u64; 7],
}
#[unsafe(no_mangle)]
@@ -74,6 +76,54 @@
pub unsafe extern "C" fn posix_spawnattr_destroy(_attr: *mut posix_spawnattr_t) -> c_int { 0 }
#[unsafe(no_mangle)]
+pub unsafe extern "C" fn posix_spawnattr_setflags(
+ attr: *mut posix_spawnattr_t,
+ flags: c_short,
+) -> c_int {
+ if attr.is_null() {
+ return Err::<c_int, _>(Errno(EINVAL)).or_minus_one_errno();
+ }
+ unsafe { (*attr).flags = flags; }
+ 0
+}
+
+#[unsafe(no_mangle)]
+pub unsafe extern "C" fn posix_spawnattr_getflags(
+ attr: *const posix_spawnattr_t,
+ flags: *mut c_short,
+) -> c_int {
+ if attr.is_null() || flags.is_null() {
+ return Err::<c_int, _>(Errno(EINVAL)).or_minus_one_errno();
+ }
+ unsafe { *flags = (*attr).flags; }
+ 0
+}
+
+#[unsafe(no_mangle)]
+pub unsafe extern "C" fn posix_spawnattr_setsigmask(
+ attr: *mut posix_spawnattr_t,
+ sigmask: *const sigset_t,
+) -> c_int {
+ if attr.is_null() || sigmask.is_null() {
+ return Err::<c_int, _>(Errno(EINVAL)).or_minus_one_errno();
+ }
+ unsafe { (*attr).sd = *sigmask; }
+ 0
+}
+
+#[unsafe(no_mangle)]
+pub unsafe extern "C" fn posix_spawnattr_getsigmask(
+ attr: *const posix_spawnattr_t,
+ sigmask: *mut sigset_t,
+) -> c_int {
+ if attr.is_null() || sigmask.is_null() {
+ return Err::<c_int, _>(Errno(EINVAL)).or_minus_one_errno();
+ }
+ unsafe { *sigmask = (*attr).sd; }
+ 0
+}
+
+#[unsafe(no_mangle)]
pub unsafe extern "C" fn posix_spawnp(
pid: *mut pid_t, file: *const c_char,
file_actions: *const posix_spawn_file_actions_t,