Commit Graph

2959 Commits

Author SHA1 Message Date
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 a5c41f77d0 ld_so: remove access dead code 2025-09-08 21:03:27 +00:00
elle 5d77f617f5 ld_so: use mutex for _r_debug
Uses a `spin::Mutex` for the global static `_r_debug` instance to remove
warning about a global mutable static.

Guarantees exclusive mutable access to the `_r_debug` variable.
2025-09-08 20:23:36 +00:00
elle a434c0ef12 cargo: add explicit editions
Adds explicit `edition` definitions to sub-crates.
2025-09-08 20:23:36 +00:00
elle 7a78c5a719 generic-rt: move format args into format string 2025-09-08 20:23:36 +00:00
elle 6b9103a5ec generic-rt: remove use of core instrinsics
Fixes warning about not using compiler intrinsics.

Calls into the `panic` macro instead of directly calling the `abort`
intrinsic.

Slightly changes the behavior of the function by printing the
panic message, unwinding, and aborting.
2025-09-08 20:23:36 +00:00
elle 01c8942a3c build: rename unsused crate_dir variable 2025-09-08 20:23:36 +00:00
elle 09015a218e ld_so: remove unsafe transmute in mmap_and_copy
Refactors casting the `raw` address as a byte array to use idiomatic
Rust APIs instead of the unsafe call to `transmute`.
2025-09-08 20:23:36 +00:00
Jeremy Soller 7e0c6a91e0 Merge branch 'refactor/remove-array-chunks' into 'master'
lib: remove `array_chunks` nightly feature

See merge request redox-os/relibc!703
2025-09-08 12:22:19 -06: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
Jeremy Soller 2f0d5eb970 Use patched openlibm to fix riscv64 2025-09-07 21:17:18 -06:00
Jeremy Soller 0a13e2574f Fix sigsetjmp definition on riscv64 2025-09-07 20:04:10 -06:00
Jeremy Soller e291a2527a Merge branch 'fix-rename-broken-link' into 'master'
Fix renaming broken symbolic link

Closes #212

See merge request redox-os/relibc!702
2025-09-07 07:06:02 -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
Jeremy Soller adc8f9f3b3 Merge branch 'lstat-unlink-test' into 'master'
Add lstat test

See merge request redox-os/relibc!701
2025-09-06 07:16:59 -06:00
Jeremy Soller 705270dba3 Merge branch 'const-init-pthread_atfork' into 'master'
Const init pthread_atfork; export in pthread.h

See merge request redox-os/relibc!698
2025-09-06 07:13:16 -06:00
Josh Megnauth 639e0f2cd7 Add lstat test 2025-09-05 23:59:36 -04:00
Josh Megnauth 51bc7f7d2c Const init pthread_atfork; export in pthread.h
`pthread_atfork` should be exported in pthread.h according to the
standard. We only exported our function in unistd.h. `glibc` exports it
in both pthread.h and unistd.h whereas musl only exports it in pthread.h
(which is standards compliant).

I exported it in both headers. Cbindgen doesn't seem to reexport `pub
use` so I declared the function twice. We might have to reexamine our
`pub use` to check what's exported and what isn't.
2025-09-01 22:21:15 -04:00
Jeremy Soller c281579ca1 Merge branch 'fix_clang_bindgen_issue' into 'master'
fixing bindgen c++ [[noreturn]] issue.

See merge request redox-os/relibc!697
2025-08-30 11:30:34 -06:00
Andrzej J. Skalski 42493b88eb fixing bindgen c++ [[noreturn]] issue. 2025-08-30 11:30:34 -06:00
Jeremy Soller 3bd7f21f05 Merge branch 'sem-timedwait' into 'master'
Add sem_timedwait and sem_clockwait

See merge request redox-os/relibc!696
2025-08-28 06:24:27 -06:00
Wildan M 4c6c5da8f2 fix fmt 2025-08-28 16:13:16 +07:00
Wildan M 80ea3bc6a1 Add sem_clockwait and fix timedwait clock_id 2025-08-28 12:58:54 +07:00
Wildan M 7ab71a0ad5 Add sem_timedwait 2025-08-28 08:36:16 +07:00
Jeremy Soller 3a08d40c67 Merge branch 'add-temporary-fstatat' into 'master'
Implement fstatat

See merge request redox-os/relibc!695
2025-08-27 06:42:55 -06: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
Jeremy Soller fd9a1c9668 Workaround clang issue with [[noreturn]] in C files 2025-08-24 18:30:13 -06:00
Jeremy Soller 92bc01247a Merge branch 'add-confstr' into 'master'
Implement confstr (unistd.h)

See merge request redox-os/relibc!694
2025-08-22 21:36:06 -06:00
Josh Megnauth 9d2f5d95dc Implement confstr (unistd.h)
The implementation for confstr is straightforward. Most of the constants
return 1 on both musl and glibc. The only constant that doesn't is
required for Fish.

I also switched an #[unsafe(no_mangle)] from my last patch back
to a #[no_mangle] because we need to bump cbindgen. #[unsafe(no_mangle)]
is required for Rust 2024.
2025-08-22 22:13:51 -04:00
Jeremy Soller 4758685217 Merge branch 'netdb-openssh' into 'master'
Implement getnameinfo and getaddrinfo loopback

See merge request redox-os/relibc!693
2025-08-20 06:59:31 -06:00
Jeremy Soller d513ba003c Merge branch 'fix-linux-sysconf' into 'master'
Improve sysconf.h on Linux

Closes #218

See merge request redox-os/relibc!691
2025-08-20 06:58:27 -06:00
Jeremy Soller f046864f10 Merge branch 'ixany-openssh' into 'master'
Add termios IXANY

See merge request redox-os/relibc!692
2025-08-20 06:54:47 -06:00
Wildan M 14bb1c87c3 Fix fmt 2025-08-20 18:40:18 +07:00
Wildan M 5334455a20 Implement getnameinfo and getaddrinfo loopback 2025-08-20 18:26:27 +07:00
Wildan Mubarok c3437b70a9 Add termios IXANY 2025-08-20 07:39:15 +00:00
Josh Megnauth 70ae45ff85 Improve sysconf.h on Linux
I copied the constants and definitions from musl which we can presume is
correct. Relibc is missing some features which affects our sysconf as
well, such as constants in limits.h or a working resources.h.
2025-08-20 02:05:05 -04:00
Jeremy Soller 8f9614920d Merge branch 'rlimit_constants_i32' into 'master'
Switch resource.h enum to c_int instead of u64

See merge request redox-os/relibc!690
2025-08-17 08:17:02 -06:00
Josh Megnauth d14ae1c148 Switch resource.h enum to c_int instead of u64
Most platforms use a c_int though glibc uses a u32. GNU defines a type,
__rlimit_resource_t, for the RLIMIT enum that is a u32.

Using a c_int is nicer for a few reasons. The first is that our
(unimplemented) functions receive a c_int for the enum - using a u32 is
technically wrong but doesn't affect anything since the constants are
turned into macros by cbindgen.

The second reason is that a c_int is nicer for libc and nix (the crate)
too since we don't need to pollute the crates with guards for Redox.
2025-08-16 23:52:03 -04:00
Jeremy Soller 89ddc82d42 Merge branch 'add-vdisable' into 'master'
Add termios constant for VDISABLE

See merge request redox-os/relibc!689
2025-08-15 06:58:42 -06:00
Josh Megnauth c3c9e3f619 Add termios constant for VDISABLE
_POSIX_VDISABLE is an extension that disables terminal special
characters.

See:
* redox-os/termios!3
* redox-os/base!27
2025-08-14 01:57:24 -04:00
Jeremy Soller f170902a29 Add u_int types for compatibility 2025-08-13 09:36:26 -06:00
Jeremy Soller f5bc50f104 Merge branch 'paths-h' into 'master'
Add paths.h for Fish

See merge request redox-os/relibc!687
2025-08-11 14:14:58 -06:00
Jeremy Soller 09b71bdbe0 Merge branch 'fix-trace' into 'master'
Fix trace feature

See merge request redox-os/relibc!686
2025-08-11 14:11:49 -06:00
Jeremy Soller 551c79c526 Merge branch 'redoxer-test' into 'master'
Enable some tests in Redox

See merge request redox-os/relibc!685
2025-08-11 14:11:16 -06:00
Darley Barreto b0aac4e8f6 Enable some tests in Redox 2025-08-11 14:11:15 -06:00
Jeremy Soller a57dbfb13f Merge branch 'test-statvfs' into 'master'
Add basic test for statvfs

See merge request redox-os/relibc!683
2025-08-11 14:10:31 -06:00
Jeremy Soller 7e1940b941 Merge branch 'printf-m-modifier' into 'master'
Add %m to printf & fix CI

See merge request redox-os/relibc!682
2025-08-11 14:09:37 -06:00