Commit Graph

624 Commits

Author SHA1 Message Date
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
Wildan M 1712290deb Define posix_dent for posix_getdents 2025-10-12 20:25:37 +07:00
4lDO2 24cf96393c Expand Out wrapper and use it in utsname. 2025-10-05 20:01:12 +02:00
Jeremy Soller ced734c162 Add RawCell::unsafe_set 2025-10-04 07:50:16 -06:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Jeremy Soller f35ddf0ec1 Merge branch 'getpeername-fix' into 'master'
Fix panic on getpeername

See merge request redox-os/relibc!728
2025-09-26 14:25:16 -06:00
Wildan M 8fa68e2927 fmt 2025-09-27 01:13:14 +07:00
Wildan M 7527de3a25 Fix panic on getpeername 2025-09-27 01:02:20 +07: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
4lDO2 38e724ece9 Properly inherit ignored sigs across exec. 2025-09-20 11:08:41 +02:00
Jeremy Soller 9fa3eceaeb Implement getsockaddr for SO_DOMAIN and SO_TYPE 2025-09-19 14:59:47 -06: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 28901b1b62 Impl AT_SYMLINK_NOFOLLOW and AT_EMPTY_PATH
AT_SYMLINK_NOFOLLOW acts on the symlink itself rather than following it.

AT_EMPTY_PATH acts on the directory if path is empty.

Currently, this is implemented in fstatat itself but the code is general
enough to be refactored once we get the other *at functions. It could
likely just live in openat itself.
2025-09-15 06:12:10 +00:00
4lDO2 e0f44e5ff5 Correct chdir comment. 2025-09-11 13:40:11 +02:00
Ibuki Omatsu b14aae168f Add getens and expose it to libredox 2025-09-09 07:35:19 -06:00
Josh Megnauth 55c2e5b8ea Fix renaming broken symbolic link
Closes: #212

The fix is simply to not follow links when opening a file to be renamed.
O_NOFOLLOW, a non-POSIX extension, does exactly that while not needing
renameat or openat.
2025-09-07 07:44:10 -04: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 b7589a63c5 Fixes to improve signals for openposixtestsuite 2025-08-04 07:37:14 -06:00
Jeremy Soller 1694cd3a4d fix redox stat st_blocks 2025-08-01 12:44:10 -06:00
Jeremy Soller 6dd10a1f11 Fix connect on redox 2025-08-01 10:33:55 -06:00
Ibuki.O b86f8a36fa feat: Add redox_get_socket_token_v0 as a symbol for libredox. 2025-07-19 13:31:44 +09:00
Ibuki Omatsu d44010170f feat: Integrate UDS bind and connect operation with RedoxFS and switch get_proc_credentials to a capability-based approach. 2025-07-18 08:57:49 -06:00
Jeremy Soller 46c2f99919 Merge branch 'unix-domain-socket' into 'master'
feat: Implement Unix Domain Socket and related features.

See merge request redox-os/relibc!662
2025-07-17 22:48:37 -06:00
Ibuki Omatsu 206239f9a2 feat: Implement Unix Domain Socket and related features. 2025-07-17 22:48:37 -06:00
Ron Williams 770dc71816 Fix CI, Add signal.h constants 2025-07-11 20:28:45 -06:00
Jeremy Soller b68ff56115 Revert "Merge branch 'use-redox-path-in-cwd' into 'master'"
This reverts merge request !669
2025-07-11 06:28:48 -06:00
Josh Megnauth db6097733c Use redox_path in canonicalize_using_cwd_internal
`redox_path` handles most of the logic anyway.
2025-07-09 22:30:51 -04:00
bjorn3 585cd80002 Expose sys_call through libredox
This makes it significantly easier to use outside of crates that already
depend on redox-rt, making it actually useful to many schemes.
2025-06-30 20:17:26 +02:00
James Matlik 19de978799 Fix issue with rename to relative destination 2025-06-12 08:56:21 -04:00
Jeremy Soller 1e48b13948 Debug recvmsg on redox 2025-05-04 09:32:10 -06:00
Jeremy Soller 275b92ee92 Make setitimer return enosys instead of panic on redox 2025-05-04 08:32:25 -06:00
Jeremy Soller 0f3f6f3c15 Use flink to implement link on redox 2025-05-03 12:18:45 -06:00
Ron Williams c779c1d941 Mark setitimer as unimplemented, obsolete 2025-04-21 23:29:35 -07:00
Jeremy Soller 4dd8cbe15e Merge branch 'no_suid' into 'master'
Remove the code to use escalated for suid binaries

See merge request redox-os/relibc!653
2025-04-21 12:21:21 +00:00
bjorn3 f51690c3a8 Remove the code to use escalated for suid binaries 2025-04-21 11:07:01 +02:00
4lDO2 32c5e89c82 Return ID of new session in setsid. 2025-04-20 17:10:51 +02:00
Jacob Lorentzon a9fd150c91 Merge branch 'redox_cur_procfd_v0' into 'master'
Add redox_cur_procfd_v0 method to get own proc_fd

See merge request redox-os/relibc!651
2025-04-20 14:22:13 +00:00
bjorn3 4755d1ae24 Add redox_cur_procfd_v0 method to get own proc_fd 2025-04-20 16:19:45 +02:00
4lDO2 a30f13ee9b Fix setuid. 2025-04-20 14:00:35 +02:00
4lDO2 5dfc76dda8 Fix signal handlers after EINTR nanosleep. 2025-04-19 19:27:03 +02:00
4lDO2 d0335b30de Use redox_rt::protocol for sig numbers. 2025-04-19 19:27:02 +02:00
4lDO2 05481b36a6 Fix IPC size on i686. 2025-04-19 19:27:01 +02:00
4lDO2 dc2988968e Use SignalThread call and fix fork sighandler sync with procmgr. 2025-04-19 19:26:59 +02:00
4lDO2 b30ccb61fe Enforce procmgr errors, fix attrs path. 2025-04-19 19:26:59 +02:00
4lDO2 ac7e0755f1 Fix SyncSigPctl invocation. 2025-04-19 19:26:59 +02:00