Commit Graph

181 Commits

Author SHA1 Message Date
auronandace 49f96a96e6 rename bits_time to bits_timespec for consistency 2026-04-09 10:50:04 +01:00
Peter Limkilde Svendsen 2d2aa5592b Document Pal methods 2026-04-06 20:12:04 +02:00
Zero caa5ef8afb chore(signal): Move alarm function and adding the todo 2026-03-31 00:19:35 +02:00
auronandace ae91f48fae remove duplicate socklen_t definition 2026-03-11 12:42:53 +00:00
Ibuki Omatsu 3385c66c6c refactor: Reimplement the *at functions using openat and CWD fd 2026-03-01 07:08:31 -07:00
auronandace 2d3ee10aef platform and pthread cleanup 2026-02-27 21:38:16 +00:00
auronandace dc4542e81c allocator and linux signal cleanup in platform 2026-02-22 08:43:20 +00:00
auronandace 4b3d1aa5ca change sa_flags in sigaction to int to match spec 2026-02-19 09:46:56 +00:00
auronandace 20bdf30526 remove allow warnings and add some lints 2026-02-15 21:38:08 +00:00
auronandace 1191d8e1b4 extract timespec to a bits header 2026-02-12 13:07:24 +00:00
Wildan M dd577957ec Fix compilation for linux ARM 2026-02-11 16:59:17 +07:00
auronandace 7d1582a555 add unused_imports lint 2026-02-10 15:55:32 +00:00
auronandace 64f18ca89a add unused_mut lint 2026-02-08 09:00:14 +00:00
4lDO2 7f27471746 return awaited signal number in sigtimedwait 2026-01-31 18:50:14 +01:00
Ron Williams 69c2e6cbba fix linux types.h 2026-01-30 16:31:54 +00:00
sourceturner defd2ce7c3 Deny deny-unsafe_op_in_unsafe_fn on the crate level 2026-01-21 00:41:57 +01:00
sourceturner 2d5ac47214 Use unsafe blocks in platform module 2026-01-18 21:51:33 +01:00
Wildan M e69e0b937e Fix linux aarch64 compilation 2026-01-16 07:09:57 +07:00
Connor-GH da140913bc Implement mkfifoat(2) 2026-01-13 01:40:25 +00:00
Jeremy Soller c433f39788 Merge branch 'add-mkdirat' into 'master'
Implement mkdirat

See merge request redox-os/relibc!878
2026-01-09 06:09:09 -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
Connor-GH 75ca2cf29e Implement mkdirat
Linux's variant uses the syscall as intended. Redox's variant uses fpath to build a path to pass to mkdir from the file descriptor plus the file name, which isn't atomic due to the fpath lookup being subject to TOCTOU when paired with mkdir.
2026-01-08 17:56:49 -06:00
Jeremy Soller 3654575ca1 Implement fexecve on Linux 2025-12-19 12:18:02 -07:00
Jeremy Soller 3b963b2745 Add missing sigsetsize argument to EPOLL_PWAIT syscall on Linux 2025-12-19 11:46:11 -07:00
Jeremy Soller 9d15760ef5 Fix chown on linux by adding fchownat flags to syscall 2025-12-19 08:59:18 -07: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
Anhad Singh 6bcdac4202 fix(platform/linux): use FCHOWNAT to implement lchown(2)
`LCHOWN` syscall is not available on aarch64.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-01 14:46:08 +11:00
Anhad Singh 6d68ca9957 fix(platform/linux): use FACCESSAT to implement access(2)
`ACCESS` syscall is not available on aarch64.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-01 14:46:08 +11:00
Anhad Singh 90963fdfb9 feat(platform/linux): stub rlct_clone
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-12-01 14:46:07 +11:00
Josh Megnauth 8e5937ca25 Implement posix_fallocate
`posix_fallocate` ensures that a byte range in a file is allocated so
that subsequent writes don't fail. Unlike ftruncate, posix_fallocate
does not shrink files.

The Linux syscall fallocate is similar to posix_fallocate except with
far more control over how byte ranges are allocated (e.g. it supports
file holes and other features). This MR doesn't implement fallocate as
it requires syscall and redoxfs support.

Finally, I changed the flags for flock from usize to c_int. That matches
what we have in libc and also avoids some silly, needless type casting.
2025-11-28 19:49:21 -05:00
Josh Megnauth f5d432644f Implement renameat, renameat2
Like the other "at" functions, renameat renames files with respect with
a directory descriptor. "renameat2" is Linux specific but really nice -
it adds a flag which supports atomically swapping two files or failing
if the target already exists. The latter is easily supported in relibc.
The former requires redoxfs support.

Besides the impl itself, I refactored "cap_path_at" into what it really
is: a mini openat2-like function.
2025-10-21 14:47:39 -04:00
Wildan M c8fce67873 Support SIGEV_SIGNAL and TIMER_ABSTIME 2025-10-16 22:37:24 +07:00
Wildan Mubarok 2efcd20fbc Implement POSIX timer functions 2025-10-15 08:10:06 -06:00
4lDO2 24cf96393c Expand Out wrapper and use it in utsname. 2025-10-05 20:01:12 +02:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Josh Megnauth b22f333319 Fix Linux build 2025-09-26 02:05:03 -04:00
Wildan Mubarok 7416ba6ff3 Implement posix_getdents 2025-09-23 10:57:13 -06:00
Josh Megnauth 85c5e889fb Implement fchmodat
Capability based `fchmod`. I also implemented unit tests for chmod,
fchmod, and fchmodat.

The unit tests check Redox-specific behavior, so some of the tests are
disabled for Linux.
2025-09-21 10:04:11 -04:00
Jacob Lorentzon 9c5f11fbc8 Add Out<T> wrapper 2025-09-21 14:36:12 +02:00
Josh Megnauth c555503a35 Implement readlinkat
Like readlink except capability based. Most of this patch is refactoring
fstatat into a reusable, openat-like private function.
2025-09-18 01:27:55 +00:00
Josh Megnauth c899feb774 Implement fstatat
Linux's variant uses the syscall as intended. Redox's variant uses fpath
to build a path to pass to fstat from the file descriptor plus the file
name. Unlike the syscall, this isn't atomic so the liminal space between
fpath/getcwd and fstat is subject to TOCTOU.

Beyond fstatat, I moved the stat test to its correct location and added
an assert since the output of the test is unchecked.

I also added AT_FDCWD which seems to be -100 across Unixes. The other
AT_* constants are unimplemented for now.
2025-08-27 08:21:41 -04:00
Ron Williams 770dc71816 Fix CI, Add signal.h constants 2025-07-11 20:28:45 -06:00
4lDO2 32c5e89c82 Return ID of new session in setsid. 2025-04-20 17:10:51 +02:00
4lDO2 a4dc232a33 Impl getres[ug]id C function. 2025-04-19 19:26:59 +02:00
4lDO2 d68f5d8d3d Make redox itimer relibc stub rather than kernel stub. 2025-04-13 18:18:05 +02:00
Josh Megnauth d6ac5f8947 Avoid over allocations & reallocations
As we know, vectors amortize the cost of adding new elements by reserving
space for multiple elements when full. This is useful but may lead to
allocating more memory than necessary.

`relibc` generally avoids over allocations by reserving the exact amount
of space when possible. I fixed a few areas that still over allocated or
reallocated unnecessarily by leveraging iterators that are more likely
to know sizes.
2024-11-14 22:53:12 -05:00
Peter Limkilde Svendsen 06fec0b843 Add various basic docstrings 2024-10-27 23:25:57 +01:00
4lDO2 07af4e49f7 Add sigaltstack test. 2024-09-28 16:51:17 +02:00
4lDO2 eee603efa8 Remove the "-1 errno" e() function. 2024-09-27 15:35:04 +02:00
4lDO2 070b4cd05c Switch PalPtrace to Rusty error handling. 2024-09-27 15:35:04 +02:00