Commit Graph

531 Commits

Author SHA1 Message Date
Wildan M ea667cdca1 Support disarming timer 2026-05-03 05:06:25 +07:00
Wildan M 9188a9e354 Make timer_internal_t atomic 2026-05-03 05:02:29 +07:00
Wildan M d16dfade59 Use less cloning for timespec 2026-05-03 03:21:06 +07:00
Wildan M 7b0354ca3d Use type casts for timespec conversion 2026-05-03 03:09:52 +07:00
Connor-GH 76d801f7cd openat2: fix internal assumption causing EINVAL
Inside of `openat2`, we are assuming that if we are passed
`AT_SYMLINK_NOFOLLOW` that we are also passed a symlink. This is simply
not the case, as POSIX defines the flag to only have a noticable effect
if the resolved path is a symlink. Therefore, we cannot assume that we
have a symlink if we see `AT_SYMLINK_NOFOLLOW`. The previous behavior
caused an `EINVAL` in redoxfs because we do a consistency check to
error out if we are passed `O_SYMLINK` (which was added because
`AT_SYMLINK_NOFOLLOW` was observed) and aren't a symlink.

Hmm, maybe a special errno like `ENOTLNK` should be deployed for this? It's
specific enough that it could possibly be added to a future POSIX.
2026-05-01 17:01:39 -05:00
Connor-GH 22faf6b615 fchownat: fix behavior for uid == -1 && gid == -1
Previously, this would error with EINVAL since the conversion to
unsigned int would fail on -1. Now, we do a bitwise conversion via
an `as` cast.
2026-04-29 15:23:56 -05:00
auronandace 6a490be2c6 split out sigset_t from signal header 2026-04-29 12:29:43 +01:00
Jeremy Soller 54d16f7a65 Merge branch 'remove-allowed-unused-imports' into 'master'
remove unused imports and #[allow(unused_imports)] annotations

See merge request redox-os/relibc!1223
2026-04-24 07:00:04 -06:00
sourceturner 8daf17e4f7 remove unused imports and #[allow(unused_imports)] annotations 2026-04-23 21:41:24 +02:00
Connor-GH 313f2be0f8 Pal: Add default method impls and remove duplicated code
I noticed that the Linux and Redox PALs both do very similar things for
a given FS function and its *at variant. For example, `mkdir()` is just
a call to `mkdirat()`. POSIX requires these to be equivalent.
Additionally, we use AT_EMPTY_PATH in some places but note that this is
not POSIX and is instead an extension that Linux (and Redox) implement.
That doesn't really matter though, since this is an implementation
detail. Implementations can choose to implement these functions anyway
and ignore the default impl. Such a case is `fstat`, because the current
Redox impl of `fstatat` relies on `fstat`, and this would cause infinite
recursion.

Future work:

POSIX says that `fcntl(fd, F_DUPFD, 0);` shall be equivalent to
`dup(fd);`. `dup2` might have cases where it can be implemented using
`dup3`. `dup` seemingly cannot be implemented in terms of `dup2`, so the
`fcntl` default implementation is sufficient. `pipe(fds)` is equivalent to
`pipe2(fds, 0);`.
2026-04-23 14:18:04 -05:00
Jeremy Soller 30cc2de953 Merge branch 'faccessat-fchownat' into 'master'
add faccessat(2) and fchownat(2)

See merge request redox-os/relibc!1213
2026-04-20 16:33:30 -06:00
Connor-GH 24e250c339 add faccessat(2) and fchownat(2)
Additionally, we were using the `access` syscall for x86_64 for our
linux PAL. I looked at the linux source and found that using the
`access`
syscall is equivalent to using `faccessat` as we do now: https://elixir.bootlin.com/linux/v6.17.5/source/fs/open.c#L550

Also, some of the `fcntl.h` functions were accidentally implemented and exported from `unistd.h`. They are supposed to be implemented in `fcntl.h` and exported to `unistd.h`. This is now the behavior.
2026-04-20 17:20:18 -05:00
sourceturner 4ffd337b9b add #[allow(deprecated)] annotations
allow using deprecated functions and data structures
in deprecated functions
2026-04-20 21:37:52 +00:00
Connor-GH 0ff79b80a2 add unlinkat(2), symlinkat(2), linkat(2) and expose openat(2)
`linkat(2)` doesn't have `AT_EMPTY_PATH` as a valid flag in this
implementation because it isn't POSIX. We have it (and have
support for it), but it is more effort to add it. If we need it at some
point, it can be added in about 3 lines.

`openat(2)` previously wasn't exposed, and William was not aware of
`Sys::openat`'s existence. We use it under the hood for `mkfifoat(2)`
and friends, so expose it as a libc API. This helps to pass more os-test tests.

Lastly, the 3 implemented syscalls here help pass some os-test tests.
2026-04-20 10:58:25 -05:00
Akshit Gaur 87b16e6d12 Priority Scheduler 2026-04-17 18:45:46 -06:00
Wildan M b73dd22020 Disable SIGARLM timer delivery 2026-04-15 21:03:36 +07:00
auronandace 8c41979aba fix redox compilation for sa_family_t 2026-04-14 08:52:31 +01:00
Benton60 7bf209dc8e Move to separate 0.0.0.0:0 and disconnected states for udp AF_UNSPEC 2026-04-10 18:55:26 +01:00
auronandace 49f96a96e6 rename bits_time to bits_timespec for consistency 2026-04-09 10:50:04 +01:00
Mathew John Roberts d6261d3868 Merge branch 'pal-docs' into 'master'
Document Pal methods

See merge request redox-os/relibc!1165
2026-04-08 19:48:47 +01:00
Peter Limkilde Svendsen 2d2aa5592b Document Pal methods 2026-04-06 20:12:04 +02:00
Peter Limkilde Svendsen 8757c0facf Formatting 2026-04-05 16:44:09 +02:00
Wildan M f348d880e7 Fix compilation 2026-04-05 20:03:40 +07:00
Jeremy Soller 933a53bfc0 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Mathew John Roberts <auronandace@duck.com>
2026-04-05 07:51:20 -06:00
Benton60 2b63e37410 fix behavior to always nullify the address regardless of what is passed in. 2026-04-05 01:26:45 -04:00
Benton60 7c733fc3b3 adding support for disconnecting via AF_UNSPEC 2026-04-04 18:27:01 -04:00
Jeremy Soller 0b880eb17d Merge branch 'split-iovec' into 'master'
split out iovec from sys_uio header

See merge request redox-os/relibc!1147
2026-04-01 08:41:26 -06:00
auronandace 5d22f7096b split out iovec from sys_uio header 2026-03-31 11:03:41 +01:00
Zero caa5ef8afb chore(signal): Move alarm function and adding the todo 2026-03-31 00:19:35 +02:00
Zero e0c9b0ed03 feat(signal): Implement alarm() and timer_settime logic
Adds the implementation for the `alarm()` function and its underlying
`alarm_timespec` helper. This involves managing a process-global POSIX timer
to deliver SIGALRM signals.
2026-03-31 00:09:07 +02:00
Wildan M 464c840697 Fix linux compilation 2026-03-29 14:39:43 +07:00
Wildan M b2de3d6e2e Implement exec cache from ld_so cache 2026-03-29 13:11:36 +07:00
auronandace 93a8b4b7c6 cargo fmt 2026-03-28 08:21:13 +00:00
Benton60 5de398c6a9 reserve extra space for scheme path to fix os-test/sys_socket/recvfrom 2026-03-27 09:49:47 -04:00
auronandace 44bb9d8d63 cargo fmt 2026-03-25 13:38:12 +00:00
Benton60 0addd84414 update recvfrom to route calls through recvmsg 2026-03-23 23:37:15 -04:00
Wildan M 0db44c3f72 Fix fchmodat with AT_EMPTY_PATH 2026-03-17 03:12:34 +07:00
Connor-GH a60b7cefc1 uname: update to reflect version info given from scheme
We recently updated the kernel to give the "version" info in the
uname scheme. Now, we also put this info in the `utsname` struct for the
`uname` function.
2026-03-15 15:49:10 -05:00
Ibuki.O ac88c8f670 refactor: Migrate fstat*/fchmod/getdents/ftruncate/futimens to stdfscall 2026-03-14 13:35:39 +09:00
auronandace 3ea60eeb72 timespec clone followup for redox 2026-03-11 14:51:06 +00:00
auronandace ae91f48fae remove duplicate socklen_t definition 2026-03-11 12:42:53 +00:00
auronandace bd4fb1f660 fix a rust lint and a clippy lint 2026-03-10 12:11:03 +00:00
Wildan M fb07b5f982 Implement getgroups 2026-03-07 11:02:50 +07:00
Ibuki Omatsu 3385c66c6c refactor: Reimplement the *at functions using openat and CWD fd 2026-03-01 07:08:31 -07:00
Ibuki Omatsu cab0021461 refactor: Move protocols into libredox 2026-02-28 08:04:47 -07:00
Anhad Singh c469792043 feat(exec/shebang): handle multiple whitespaces
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-28 00:14:28 +11:00
Anhad Singh 79c3674c10 feat(redox/exec): replace argv[0] with script
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2026-02-28 00:14:21 +11:00
Ibuki Omatsu bd9c6f1440 refactor: Make processes have cwd as a capability 2026-02-26 06:09:27 -07:00
Jeremy Soller 1ff26de318 Merge branch 'flock' into 'master'
feat(redox): flocking

See merge request redox-os/relibc!1037
2026-02-25 08:20:46 -07:00
Jeremy Soller e8fb4604fb Merge branch 'fix-mprotect' into 'master'
fix: return EINVAL for invalid `prot` of `mprotect`

Closes #259

See merge request redox-os/relibc!976
2026-02-24 08:10:46 -07:00