Commit Graph

12 Commits

Author SHA1 Message Date
Red Bear OS fc8f0ec4fd Fix sched.h: use style=Both so sched_param has typedef (needed by spawn.h) 2026-06-27 23:53:21 +03:00
Red Bear OS f00e969b82 Fix: remove unnecessary unsafe block for safe sched_setscheduler call 2026-06-27 23:50:21 +03:00
Red Bear OS 3cb57fbc7f Add posix_spawnattr_{get,set}schedpolicy and schedparam functions 2026-06-27 23:45:14 +03:00
Red Bear OS a500cd9e6c Fix spawn.h: use style=Both for typedef-compatible posix_spawn types 2026-06-27 23:34:18 +03:00
Red Bear OS 32e402087f Fix sigaction.sa_flags type: c_int -> c_ulong
nix 0.30.1 expects SaFlags_t = c_ulong for target_os = "redox"
(see nix-0.30.1/src/sys/signal.rs:430). Our relibc had c_int,
causing type mismatch errors in uutils and any nix-dependent crate.
Align with nix's expectation.
2026-06-27 22:26:56 +03:00
Red Bear OS 2cd334a1f9 Fix cpuid unsafe wrapper for Rust 1.98 compatibility
__cpuid is unsafe in Rust 1.92 but safe in 1.98. Wrap with
#[allow(unused_unsafe)] and explicit unsafe block for both versions.
2026-06-27 22:03:51 +03:00
Red Bear OS ae6549251b Implement spawn.h + fix VaList API for Rust 1.98 + signal.h stdint.h
spawn.h: Implement posix_spawn/posix_spawnp with file actions and
spawn attributes (flags, pgroup, sigmask, sigdefault). Uses fork+exec.

signal/cbindgen.toml: Add stdint.h to sys_includes for signalfd_siginfo
fixed-width integer types (uint32_t, int32_t, etc.).

VaList API migration for Rust 1.98.0-dev toolchain:
- VaListImpl merged into VaList (core::ffi::VaList)
- .arg()/.arg::<T>() renamed to .next_arg()/.next_arg::<T>()
- .as_va_list() removed (parameter is already VaList)
- .with_copy() replaced with .clone()
- printf.rs: Fix double-dereference cast for inline VaListInner

redox-rt/signal.rs: Remove unnecessary unsafe around __cpuid (safe in
new nightly).
2026-06-27 21:47:37 +03:00
Red Bear OS 31ee8b3bf9 signal/cbindgen.toml: add stdint.h to sys_includes for signalfd_siginfo types
The signalfd_siginfo struct uses uint32_t, int32_t, uint64_t, uint16_t
which require <stdint.h>. Without it, gnulib-based packages (m4, bison,
flex) fail configure's sigset_t test because signal.h doesn't compile.
2026-06-27 21:10:13 +03:00
Red Bear OS a2e4cd27fe Fix inttypes.h circular include: use stdint.h+stddef.h instead of wchar.h
inttypes.h included wchar.h for wchar_t and stdint.h, but this created
a circular dependency: wchar.h → stdint.h → gnulib inttypes.h →
inttypes.h → wchar.h. When gnulib's wchar.h wrapper was re-entered
during this cycle, wint_t and mbstate_t were not yet defined.

POSIX spec says inttypes.h should include stdint.h directly and
wchar_t comes from stddef.h. Using stdint.h + stddef.h breaks the
circular chain at its source.
2026-06-27 14:31:34 +03:00
Red Bear OS d28963d88e Fix wchar.h circular include: define types before stdio.h
relibc's wchar.h included <stdio.h> before defining wint_t and
mbstate_t. The circular chain wchar.h → stdio.h → inttypes.h →
wchar.h caused gnulib's wchar.h wrapper (used by m4, bison, etc.)
to see 'unknown type name wint_t' and 'unknown type name mbstate_t'.

Fix: Move stdio.h and time.h from sys_includes (which cbindgen
emits before type definitions) into after_includes, after wchar_t,
wint_t, and mbstate_t are defined. Also define mbstate_t manually
in after_includes with a guard, and exclude it from cbindgen export
to prevent duplicate definitions.
2026-06-27 14:22:45 +03:00
Red Bear OS 047e7c09da Add __fseterr and __freadahead to stdio ext (P3-stdio-fseterr patch) 2026-06-27 09:22:51 +03:00
Red Bear OS 1b3e94a20d Red Bear OS relibc baseline
From release 0.1.0 pre-patched archive.
This includes all Red Bear modifications previously maintained
as patches in local/patches/relibc/.
2026-06-27 09:19:26 +03:00