Red Bear OS
323b95416b
redox: implement getrlimit/setrlimit with a per-process limits table (finite RLIMIT_NOFILE)
2026-07-16 06:39:43 +09:00
Red Bear OS
a0b7e0ab64
fix(spawn): install bootstrap fds in child file table
...
The copied child table did not reliably retain the thread and process descriptors at the numbers exported through auxv. Explicitly clone both descriptors into the selected child table before loading the image, and remove the ineffective parent-handle leak.
2026-07-14 18:55:06 +09:00
Red Bear OS
7a8c7564ba
fix(spawn): leak child thread fd to prevent race with dynamic linker
...
posix_spawn creates a new context and returns its thread fd to the
parent. The kernel currently does not keep a self-reference to the child
context's thread fd, so when the parent closes its handle, the child's
thread object may be destroyed before the dynamic linker reads
AT_REDOX_THR_FD from auxv and opens regs/env. Leak the parent handle
until the kernel is fixed to retain a reference per context.
2026-07-14 16:37:24 +09:00
Red Bear OS
d2648af84a
fix(pipe2): use FILETABLE-aware open/dup to keep kernel/userspace fd tables in sync
2026-07-14 08:01:33 +09:00
Red Bear OS
eac112e919
relibc: fix pipe2 to use raw syscalls + register_external_fd
...
The previous pipe2 implementation used redox_rt::sys::open() which goes
through the FILETABLE's insert_upper mechanism. This can collide with
the untracked namespace fd (ns_fd) stored in DYNAMIC_PROC_INFO, causing
the kernel to overwrite the namespace fd entry with a pipe scheme root
entry. Subsequent open() calls then resolve to the wrong scheme, and
kdup fails with EBADF because it receives a write-end (odd) ID instead
of a read-end (even) ID.
Fix: bypass the open() function entirely and use raw syscall::openat +
syscall::dup, then register both fds with register_external_fd so the
FILETABLE tracks them correctly.
2026-07-13 22:13:02 +03:00
Red Bear OS
9ada7b78bb
relibc: remove PIPE_DIAG debug noise, fix F_SETFD arg in pipe2
...
Remove eprintln debug output from pipe2() FdGuard::open error path.
Fix F_SETFD argument: pass flags & O_CLOEXEC instead of write_flags
(which includes O_WRONLY — not an fd flag).
2026-07-13 21:13:04 +03:00
Red Bear OS
5049c25a79
diag: print ns_fd in pipe2 on failure
2026-07-12 12:15:24 +03:00
Red Bear OS
fa54b985ff
absorb: 27 orphaned relibc patches re-applied (Phase 1.0A)
...
Per local/docs/PATCH-PRESERVATION-AUDIT-2026-07-12.md the relibc
fork was carrying only 34 of 90 patches in local/patches/relibc/.
The other 56 patches' content was silently missing from the fork.
This commit re-applies 27 patches that genuinely still apply
cleanly. Recovery covers:
- eventfd implementation (sys/eventfd.h + eventfd.rs)
- signalfd implementation (sys/signalfd.h + signalfd.rs)
- timerfd implementation (sys/timerfd.h + timerfd.rs)
- bits/eventfd.h header
- spawn() function: cbindgen + stdint fix
- P3-timerfd-cbindgen-fix
- cbindgen language=C fixes for sys/{timerfd,semaphore}
- stdint include chain fixes
- strtold implementation
- dns aaaa getaddrinfo ipv6
- various stack/threading/header threading fixes
- dup3 syscalls
- waitid implementation
- bits/timespec reverse_from
- open_memstream integration
24 files changed.
2026-07-12 01:29:50 +03:00
Jeremy Soller
52bb3bbfe3
Merge branch 'ptr-offset-by-literal-lint' into 'master'
...
add ptr_offset_by_literal clippy lint and set to deny
See merge request redox-os/relibc!1527
2026-07-06 06:04:43 -06:00
auronandace
bf6dc24407
add ptr_offset_by_literal clippy lint and set to deny
2026-07-06 12:40:43 +01:00
Wildan M
812982556a
Parse flags when logging openat
2026-07-06 05:35:13 +07:00
Jeremy Soller
9930a90de0
Merge branch 'all-path' into 'master'
...
Adapt with new redox-path
See merge request redox-os/relibc!1504
2026-07-05 10:53:21 -06:00
Wildan M
2e8ee25139
Add open trace logging
2026-07-05 19:28:23 +07:00
Wildan M
c0cdc017d3
Adapt with new redox-path
2026-07-05 19:27:57 +07:00
Wildan M
7f4c3803bc
Fix curl EOPNOSUPP due to MSG_NOSIGNAL
2026-07-05 15:33:40 +07:00
auronandace
e714c570bc
make mut_from_ref deny
2026-07-02 08:28:38 +01:00
Ibuki Omatsu
fba233467a
refactor: Move fd allocation logic into userspace
2026-07-01 08:08:23 -06:00
Wildan M
b5e764d967
Fix posix_spawn launching sh script
2026-06-23 12:22:31 +07:00
Wildan M
c234ace91d
Use ArrayString for Cwd
2026-06-22 22:13:24 +07:00
Mathew John Roberts
4e4ed8b8c7
Merge branch 'dis-spawn-test' into 'master'
...
Disable spawn test temporarily
See merge request redox-os/relibc!1484
2026-06-21 19:37:51 +01:00
Wildan M
c47b492717
Disable spawn test temporarily
2026-06-21 14:54:58 +07:00
Wildan M
73a8c843a8
Fix relative program path handling in posix_spawn
2026-06-21 14:12:05 +07:00
Wildan M
5779743a9a
Remove posix_spawn string allocation
2026-06-20 12:31:32 +07:00
Wildan M
56d5fe6bce
Fix posix_spawn various issues
2026-06-20 07:05:28 +07:00
Mathew John Roberts
09ae605623
Apply 1 suggestion(s) to 1 file(s)
...
Co-authored-by: Wildan Mubarok <willnode@wellosoft.net >
2026-06-18 13:02:25 +01:00
auronandace
d0760c2b90
fix amount
2026-06-18 12:25:40 +01:00
auronandace
c84f1f41fb
use SYMLOOP_MAX in resolve_sym_links in redox path
2026-06-18 12:06:56 +01:00
Mathew John Roberts
da55b3be0e
Merge branch 'spawn' into 'master'
...
Add support for `posix_spawn` and `posix_spawnp` (Redox OS)
Closes #192
See merge request redox-os/relibc!1333
2026-06-17 06:18:59 +01:00
auronandace
f5c0c1a9c9
split out ucred to a bits header
2026-06-16 08:04:26 +01:00
R Aadarsh
1ff7d7bba0
* Fix pgroup inheritance
...
* Remove unnecessary nesting
* Make the child process explicitly inherit parent's u/g id
2026-06-15 17:08:11 +05:30
R Aadarsh
58fefac9f5
Enable sched params change
2026-06-15 17:08:11 +05:30
R Aadarsh
484fe42c0e
* Add docs
...
* Change safety signatures
* Change tests
* Correctly set u/g id
2026-06-15 17:08:11 +05:30
R Aadarsh
6d14437f34
Implement u/g id change based on executable's s(u/g)id mode bit
2026-06-15 17:08:11 +05:30
R Aadarsh
ad151e0de8
* Correctly determine argv[0]
...
- If the function called is `posix_spawnp`, and the passed program name **does not** contain a slash, the path is used unmodified, and the path to the directory containing the program on $PATH is prepended to the program's path and assigned to `argv[0]. If the program name **does** contain a slash, the path is absolutised relative to CWD, and assigned to argv[0]
- If the function called is `posix_spawn`, the behaviour is as described above in the case where path contains a slash
* Add initial tests
2026-06-15 17:08:11 +05:30
R Aadarsh
a941458ba0
Remove the use of platform::redox::path
2026-06-15 17:08:11 +05:30
R Aadarsh
fefea0f0a9
Make code safer by disallowing NULL argv, empty argv and NULL values for pointer arguments to functions
2026-06-15 17:08:11 +05:30
R Aadarsh
8c65ed481a
Make path to be owned
2026-06-15 17:08:11 +05:30
R Aadarsh
91933b4165
* Change Operation to Action
...
* Change the linked list to a `Vec<Action>`
* Make functions unsafe
2026-06-15 17:08:11 +05:30
R Aadarsh
2df7484e6c
* Make posix_spawnp consider the program argument as a path if it contains a slash
...
* Remove existence and file type check
* Make envp optional
* Ensure that the CWD of the calling process is same before and after spawning
2026-06-15 17:08:11 +05:30
R Aadarsh
38af072426
Implement chdir and fchdir operations
2026-06-15 17:08:11 +05:30
R Aadarsh
db5eeb7c20
Remove call to close, instead make the kernel remove the file
2026-06-15 17:08:11 +05:30
R Aadarsh
a6e1b269af
* Make dup2 work
...
* Use `CloseCloExec` for closing O_CLOEXEC files
2026-06-15 17:08:11 +05:30
R Aadarsh
4df38b6f0d
* Implement open operation
...
* Comment out the code for dup2
2026-06-15 17:08:11 +05:30
R Aadarsh
0810991d7d
Do the requested sigmask changes and u/g id changes
2026-06-15 17:08:11 +05:30
R Aadarsh
0e5210cb4d
Make close operation work
2026-06-15 17:08:11 +05:30
R Aadarsh
e3d2257f64
* Make posix_spawn_file_actions_t an iterator
...
* Fix bug that caused the spawned process to not start
* Make the spawned process inherit the parent's file descriptos
2026-06-15 17:08:11 +05:30
R Aadarsh
119f078216
* Fix bug that caused pid of the child process to be returned instead of 0 or errorno
...
* Add `same_process` field to not change the address space when `fexec_impl` is called on a different process
2026-06-15 17:08:11 +05:30
R Aadarsh
1bc472e7e1
Add posix_spawn and posix_spawnp for RedoxOS
2026-06-15 17:08:11 +05:30
auronandace
94b2f29beb
tackle various clippy lints
2026-06-05 14:36:06 +01:00
sourceturner
e39106835a
fix compiler warnings
2026-06-04 17:33:37 +02:00