Commit Graph

163 Commits

Author SHA1 Message Date
Jeremy Soller 72d2b1137c Implement quick_exit and at_quick_exit 2025-04-11 18:09:44 -06:00
Jeremy Soller d9a28156ce Disable at_quick_exit 2025-04-11 16:25:12 -06:00
bjorn3 8650ac293e Fix building on targets with unsigned c_char 2025-03-30 16:35:29 +02:00
Anhad Singh 0449c35e52 chore: fix formatting
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-31 01:23:51 +11:00
Anhad Singh 5eeb59dad2 feat(rand48): rwlock for global params
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-31 01:23:20 +11:00
Josh Megnauth 90f934c769 Exit should return never (!)
`_Exit`, `exit`, and related functions should return `!` because they
don't return. This also signals to cbindgen that it should emit
`[[noreturn]]` for those functions.
2024-11-23 03:33:00 -05:00
Jeremy Soller 7b2e315c17 Merge branch 'cbindgen-use-attributes' into 'master'
Emit C attributes via cbindgen

See merge request redox-os/relibc!548
2024-11-17 16:15:07 +00:00
Josh Megnauth 5348273ccc Emit C attributes via cbindgen 2024-11-17 16:15:07 +00:00
Peter Limkilde Svendsen c440c61e58 Avoid unnecessary intrinsic in calloc 2024-11-09 17:35:09 +01:00
Peter Limkilde Svendsen 890be6fc02 Add docs for stdlib.h, add stubs for missing functions 2024-11-08 14:45:26 +00:00
Peter Limkilde Svendsen 35d7a0ac3f Add docs to rand48 functions 2024-10-29 21:22:27 +01:00
Andrey Turkin a4122753e6 Initial RISC-V64 support 2024-10-11 06:44:54 +03:00
Jeremy Soller ef22cf9dfa Implement mkdtemp 2024-10-09 08:58:47 -06:00
4lDO2 8b8b00da01 Use unsigned return values in read()-like Pal fns.
Returning a negative number of bytes makes absolutely no sense, besides
the "-1 and errno" pattern, which is now converted to Result<_, Errno>.
2024-09-27 10:39:26 +02:00
4lDO2 313b32c815 Switch almost all of Pal to Rusty error handling. 2024-09-27 10:19:44 +02:00
4lDO2 4b687c25d2 Convert more Pal methods to Result. 2024-09-26 16:24:01 +02:00
4lDO2 6e5959b3fa Convert a bunch of c_int to Result<(), Errno>. 2024-09-26 16:21:34 +02:00
4lDO2 c0e7af5289 Backwards-compatibly rewrite getdents to use special syscall. 2024-09-11 23:32:19 +02:00
4lDO2 198caa3bc5 Rustify Sys::open and some fs:: error handling. 2024-09-11 23:22:32 +02:00
Peter Limkilde Svendsen d20b29c552 Un-mutexify random() default buffer 2024-08-18 22:19:22 +00:00
Peter Limkilde Svendsen 3193656f22 Put random() state behind mutex 2024-08-15 23:26:16 +00:00
bjorn3 49c708f537 Remove all uses of the legacy scheme syntax" 2024-08-04 13:49:10 +02:00
Peter Limkilde Svendsen dbcf8049fc Refactor rand48 functions with less unsafe 2024-07-15 17:44:56 +00:00
Peter Limkilde Svendsen a7137512fa Use standard casing and mangling for internal errno 2024-03-01 00:25:42 +00:00
Peter Limkilde Svendsen 9093f6bc47 Use Cell representation for errno 2024-02-29 14:07:40 +00:00
Jeremy Soller af7441e834 Implement grantpt as no-op 2024-01-18 13:26:14 -07:00
Darley Barreto 9d8094baee Add forkpty, ptsname and posix_openpt 2024-01-17 03:05:50 +00:00
Jeremy Soller a8f9f64274 Fix stack_chk_guard size on 32-bit 2024-01-11 09:41:17 -07:00
4lDO2 5630b6e0df Make relibc (except libm) pure Rust 2024-01-11 13:08:06 +00:00
4lDO2 75d1c67ca2 Switch to a lightweight CStr wrapper 2023-11-04 18:29:38 +00:00
Florian Meißner 14709b3d5c system(): on command == NULL, return nonzero if shell exists 2023-05-29 20:54:34 +02:00
4lDO2 cdd0f67b23 Rustfmt. 2023-05-17 15:28:10 +02:00
Jeremy Soller 51c93c4b39 Cleanup of wchar_t and wint_t definitions 2023-05-11 10:41:49 -06:00
Jeremy Soller 848fde933b Merge branch 'remove_pthreads_emb' into 'master'
Replace pthreads-emb with a native implementation

See merge request redox-os/relibc!380
2023-05-11 13:56:11 +00:00
Darley Barreto 7155005be2 Adding wcsrtombs. 2023-05-08 12:39:53 +00:00
4lDO2 b9f19f4326 Get pcid to work using this pthread impl. 2023-05-06 17:02:51 +02:00
David Carlier eb87e2b796 fix no_mangle annotation missing 2023-04-26 19:42:29 +01:00
David Carlier 40b1cec31e stdlib: unlockpt implementation proposal 2023-04-18 21:24:53 +01:00
David Carlier cde60c9f0e stdlib: getsubopt implementation proposal. 2023-04-16 10:58:46 +01:00
David Carlier 3fe37e36fa reallocarray introduction available on glibc 2.26. allocates an array of m*n elements but checking for overflow. 2023-03-26 08:35:44 +01:00
Jeremy Soller 0646140d99 Remove detailed abort, too many compatibility issues 2023-03-10 11:33:53 -07:00
Jeremy Soller e7b70fdb93 Ensure assert_fail and abort have noreturn attribute 2023-03-10 11:23:56 -07:00
Jeremy Soller 47bd55451f Detailed information on abort using macro and new __abort function 2023-03-09 20:19:27 -07:00
Ian Douglas Scott ff70567cd6 Fix definition of wcstombs 2023-01-13 21:49:28 -08:00
Jeremy Soller 9e0c53f222 Make long 32-bits on 32-bit systems 2022-12-01 18:33:00 -07:00
Jeremy Soller 16abc91341 cargo fmt and cargo fix 2022-11-11 13:27:18 -07:00
Jeremy Soller 3eb52eabf5 Fix missing NUL for setenv 2022-08-04 08:55:01 -06:00
4lDO2 c95d276af9 Allow POSIX's environ to be set.
Rust's libstd for example uses environ when using the `envs` builder
method for spawning processes, and therefore relibc cannot simply assume
environ will always point to the internal relibc env var Vec.
2022-07-26 21:33:01 +02:00
Mateusz Tabaka 02f202ff83 Use BufWriter (instead of LineWriter) for FILEs other than stdout and stderr
BufWriter has more capacity (8k vs 1k) and doesn't flush the stream after '\n'.
That change helps to reduce the number of syscalls, especially when dealing with text files.

Since BufWriter has a different way of getting number of pending elements than LineWriter -
Pending trait was introduced to deal with that.
2021-01-14 18:45:14 +01:00
Mateusz Tabaka 6332828725 Call DSO destructors during exit() 2021-01-05 20:39:36 +01:00