Commit Graph

223 Commits

Author SHA1 Message Date
Ibuki Omatsu 94b0cfc682 refactor: Reimplement recvmsg and sendmsg using bulk fd passing. 2026-02-07 19:48:59 -07:00
bjorn3 24aaf8fac9 redox-rt: Use Option rather than MaybeUninit + bool 2026-02-07 18:37:37 +01:00
4lDO2 61f42d6b93 Fix panic in sigtimedwait with per-thread rt sig. 2026-02-06 12:16:10 +01:00
4lDO2 bc6784d5ed Replace EINTR with ERESTART in posix_sigqueue. 2026-02-05 15:15:41 +01:00
Jeremy Soller 1398c2b0fb Merge branch 'fix_raise_sigrtmax' into 'master'
Remove incorrect sig number check in raise.

Closes #255

See merge request redox-os/relibc!959
2026-02-05 06:31:29 -07:00
4lDO2 7004484ac1 Avoid redundant sig trampoline jump in sigprocmask. 2026-02-05 12:10:00 +01:00
Ron Williams 05bc77d7be Use posix_kill instead of posix_sigqueue for non-realtime signals 2026-02-05 04:31:49 +00:00
Jacob Lorentzon eeba32b3a2 misc signal fixes 2026-01-22 07:35:04 -07:00
sourceturner e6ce5628da Use unsafe blocks in redox-rt 2026-01-21 22:41:46 +01:00
Ibuki Omatsu 1bcb6dff78 Introduce namespace fd and related features 2026-01-20 20:43:05 -07:00
Akshit Gaur 3754effab8 Add shutdown syscall 2026-01-19 21:58:06 +05:30
Jeremy Soller a04c27a71e Early exit from poll if there are fds, and all are closed 2026-01-09 12:59:00 -07:00
Jeremy Soller 0a9095bb17 Fix epoll_pwait callback internally handling EINTR 2026-01-09 12:21:38 -07:00
Jeremy Soller d8f47cf5fb Handle signal mask in epoll_pwait 2026-01-09 11:46:54 -07:00
Anhad Singh df647941c5 misc(pthread): remove the need for tid_mutex
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-01-09 22:55:58 +11:00
Jeremy Soller 13b93e0f90 Merge branch 'master' into 'master'
fix(redox-rt/signal/x86_64): corrupted `r8`/`r10`

See merge request redox-os/relibc!817
2025-12-17 21:34:45 -07:00
Anhad Singh afbd5986a5 fix(redox-rt/signal/x86_64): corrupted r8/r10
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-18 14:03:13 +11:00
Ibuki Omatsu efa5b73015 refactor: Replace unlink and rmdir with unlinkat. Improve fork using ForkScratchPad. 2025-12-17 18:32:07 -07:00
Anhad Singh f7aa718596 fix(redox-rt/proc): min_mmap_addr being set too low
`cmp::min` -> `cmp::max` Want to make sure we set the `min_mmap_addr` to
the top of the executable.

`update_min_mmap_addr(STACK_TOP - STACK_SIZE, STACK_SIZE);` needs to be
removed since we cannot allocate above that.

Reverts to the old behaviour. In future may want to consider loading the
executeable here instead of the dynamic linker (and before the dynamic
linker) to avoid any further conflicts.

Fixes `gcc` crashing at "failed to map
/usr/libexec/gcc/x86_64-unknown-redox/13.2.0/cc1. errno: 17" (where 17
-> EEXIST).

Co-authored-by: @bjorn3
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-12 17:49:36 +11:00
Anhad Singh 3f986068e9 fix(redox-rt/proc): from_raw should negate raw for
`KillProcTarget::ProcGroup`

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-10 14:46:16 +11:00
bjorn3 dc77995b57 redox-rt: Remove unnecessary image_file field from FexecResult::Interp 2025-12-09 22:22:09 +01:00
bjorn3 c96aeea39f redox-rt: Get rid of BTreeMap usage in fexec_impl 2025-12-09 21:04:45 +01:00
bjorn3 0158b111e0 redox-rt: Use non-fixed and anonymous remote mmap 2025-12-09 21:04:40 +01:00
bjorn3 1ede79fe88 Move cloexec and deactivate_tcb handling into redox-rt 2025-12-08 22:19:57 +01:00
bjorn3 b607877c07 Move cloexec handling to happen right before the final exec
This way if the target can't be executed, cloexec fds remain open as
expected.
2025-12-08 20:39:55 +01:00
bjorn3 4dae665cbf Hard code the default scheme to file
Init no longer changes the default scheme to initfs at any point in
time. And for sandboxing you would be switching scheme namespace, not
default scheme.

It should be possible to mix and match relibc version from before and
after this change without breaking exec, though I haven't tested it.
2025-12-07 19:51:45 +01:00
bjorn3 45a58f1a9e Account for nul terminator in total_args_envs_auxvpointee_size 2025-12-07 19:38:14 +01:00
bjorn3 6021ece539 Calculate total_args_envs_size in redox_rt::proc::fexec_impl
Calculating it earlier is a micro-optimization that doesn't seem like it
matters at all compared to all other costs of spawning a process. But at
the same time it makes things more fragile. And in fact bootstrap
actually passed the wrong value. It passed the
total_args_envs_auxvpointee_size that it computed rather than the
total_args_envs_size. While over-approximation doesn't cause UB, it
unnecessarily increases the amount of memory used after exec.

In addition pass &[&[u8]] rather than iterators for args and envs to
enable precomputing the total arg and env size. This also prevents you
from forgetting to pass a reversed iterator.
2025-12-07 18:52:47 +01:00
Jeremy Soller 01f01d3bd4 Fix for F_DUPFD_CLOEXEC, add TODO for usage in upper table 2025-11-17 17:46:57 -07:00
Jeremy Soller 0844e6fc90 WIP: use upper fd table 2025-11-15 07:55:37 -07:00
Ibuki Omatsu 06d5cb0bfd fix: Fix getpeername for unix sockets adding SocketCall::GetPeerName and using SYS_CALL. 2025-11-10 06:20:46 -07:00
Jeremy Soller 222278edf9 Format 2025-11-01 10:41:15 -06:00
Jeremy Soller ab2a948d0b Abort on panic or oom, remove stabilized let_chains feature 2025-10-30 09:33:29 -06:00
Josh Megnauth e39b27664f unsafe_op_in_unsafe_fn: ld_so, generic/redox-rt
There are a few functions where I allowed the lint. The lower level and
FFI nature of relibc means that there are areas with a lot of unsafe.
Some functions are basically long blocks of unsafe or contain lots of
small blocks of unsafe. unsafe_op_in_unsafe_fn doesn't add clarity to
these functions. Instead, it reduces readability by adding an indent or
small "unsafe { .. }" clutter.
2025-10-04 21:36:51 -04:00
Jeremy Soller 7ed934a01d Fix compilation of redox-rt without proc feature 2025-10-04 08:05:46 -06:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Jeremy Soller 43b0f235ca Implement pthread_getattr_np 2025-09-30 12:49:22 -06:00
4lDO2 3ad1ba516e sigaltstack: don't fail when onstack && new==NULL. 2025-09-20 11:38:14 +02:00
4lDO2 38e724ece9 Properly inherit ignored sigs across exec. 2025-09-20 11:08:41 +02:00
4lDO2 37c2f3026a Clear pending SIGCHLD also when set to SIG_DFL. 2025-09-20 10:37:26 +02:00
4lDO2 437786f6a1 Restrict posix_exit to & 0xFF to fix EINVAL panic. 2025-09-10 15:10:06 +02:00
4lDO2 23c65bab66 Revert to using abort() for extraordinary panics. 2025-09-09 20:09:29 +02:00
Jeremy Soller 7c4a87da39 Merge branch 'getens' into 'master'
Add getens and expose it to libredox

See merge request redox-os/relibc!705
2025-09-09 07:35:19 -06:00
Ibuki Omatsu b14aae168f Add getens and expose it to libredox 2025-09-09 07:35:19 -06:00
elle e148be2296 redox-rt: remove unused code from proc 2025-09-08 21:03:28 +00:00
elle 5a8c166e67 redox-rt: clean up unused code
Removes unused imports, and replaces calls to `core::intrinsics::abort`
with `panic` macro call.
2025-09-08 21:03:28 +00:00
elle 5032708f88 redox-rt: fix dead code in sync 2025-09-08 21:03:27 +00:00
elle 9f446e2fd3 redox-rt: remove signal dead code 2025-09-08 21:03:27 +00:00
elle bd13557f98 lib: remove array_chunks nightly feature
Removes the nightly `array_chunks` feature, since it is marked as
unlikely to be merged.

Usage is trivially refactored using iterators.
2025-09-08 17:08:22 +00:00
4lDO2 518798f64e Return EINVAL when killing with sig > 64. 2025-07-18 21:50:01 +02:00