Commit Graph

104 Commits

Author SHA1 Message Date
auronandace a3c67e898d add unused_must_use lint 2026-02-11 09:48:47 +00:00
auronandace 9b39861779 add mismatched_lifetime_syntaxes lint 2026-02-08 21:45:15 +00:00
auronandace c3f3e051e1 add unused-unsafe lint 2026-02-08 15:39:48 +00:00
Wildan M f15322453b Convert all println to log or todo 2026-01-25 05:27:38 +07:00
sourceturner defd2ce7c3 Deny deny-unsafe_op_in_unsafe_fn on the crate level 2026-01-21 00:41:57 +01:00
sourceturner b3f7db83cf Use unsafe blocks in stdio.h implementation 2026-01-16 21:49:01 +00:00
Wildan M 6ef56f5bc9 Use pthread recursive mutex for flockfile 2026-01-07 00:54:20 +07:00
Jeremy Soller f3afff08de Adjust ftell for write buffer 2025-12-24 20:13:13 -07:00
auronandace 95f7a12b8b only import needed types 2025-12-16 16:46:05 +00:00
auronandace 887a53c1b2 update and add spec links 2025-12-16 16:42:08 +00: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
4lDO2 6dc2606886 Expand CStr to make PrintfIter fully safe. 2025-10-06 16:16:48 +02:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
4lDO2 9aeb9abd97 Add safe strchr method for CStr. 2025-09-21 17:00:45 +02:00
Jacob Lorentzon 9c5f11fbc8 Add Out<T> wrapper 2025-09-21 14:36:12 +02:00
Bendeguz Pisch 4fc80ea7b0 Implement syslog functionality 2025-07-17 22:49:51 -06:00
Jeremy Soller 121e733990 Merge branch 'fix_arm64' into 'master'
Fix building for arm64

See merge request redox-os/relibc!636
2025-03-30 16:26:41 +00:00
bjorn3 8650ac293e Fix building on targets with unsigned c_char 2025-03-30 16:35:29 +02:00
Josh Megnauth 51c04d2470 Use C string literals & deprecate c_str! 2025-03-14 21:17:53 -04:00
Josh Megnauth d63f0249e2 fix: cbindgen emits wrong vsscanf signature
`cbindgen` emits `...` instead of `va_list` when the final parameter is
named `__valist`.
2025-02-22 00:19:51 -05:00
Jeremy Soller 01d7f7b44a Fixup last commit 2025-01-09 10:22:28 -07:00
Jeremy Soller 431d55aa24 Add setlinebuf 2025-01-09 10:21:17 -07:00
Ron Williams 9df3708a1a fix popen, improve tests 2024-12-26 17:14:15 -08:00
Anhad Singh c286ad2868 fix(ld.so): do not depend on TLS at all
In the next big refactor (next PR), all of the platform functionality
used by both relibc and ld.so will be moved into a `platform`/`sysdeps`
crate and then ld.so would be moved out of relibc and not link with it.

I think doing it in a seperate PR would make it more managable, as when
I did half of it, the diff was pretty huge and that way it would be
easier to review too :)

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-05 23:11:59 +11:00
Josh Megnauth 6f5794f636 fix(stdio): perror should be allowed to take NULL prefixes as per spec 2024-10-29 12:27:22 +00: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
Jeremy Soller a38638542d Merge branch 'ctermid' into 'master'
Implement ctermid()

See merge request redox-os/relibc!490
2024-08-01 18:42:29 +00:00
Agoston Szepessy cdf5c70d5b Implement ctermid() 2024-07-25 11:32:26 +02:00
Agoston Szepessy bb1e8fe8d7 Implement dprintf and vdprintf 2024-07-23 22:15:53 +02: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
4lDO2 5630b6e0df Make relibc (except libm) pure Rust 2024-01-11 13:08:06 +00:00
Arthur Paulino d4eddbf42e Refactor: inline core_io
* Extract the minimal set of definitions from `core_io` to `relibc` itself

* Remove dependency on `core_io`
2023-12-24 17:06:27 -03:00
4lDO2 75d1c67ca2 Switch to a lightweight CStr wrapper 2023-11-04 18:29:38 +00:00
Noa df6f4678e8 Fix warnings 2023-05-30 13:46:17 -05:00
4lDO2 cdd0f67b23 Rustfmt. 2023-05-17 15:28:10 +02:00
David Carlier bae8bb68df lockf implementation proposal 2023-05-16 23:40:40 +01:00
Jeremy Soller e1ecdbd8a5 Implement vfwprintf 2023-05-11 07:48:49 -06:00
David Carlier 637dd22d3d stdio: implements legacy cuserid proposal. 2023-04-05 22:17:09 +01:00
Jeremy Soller cc0ac982c4 Implement __fpurge 2023-03-10 08:37:54 -07:00
Jeremy Soller 59b2e32953 Fix compilation on 32-bit systems 2022-12-02 08:00:36 -07: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
Wren Turkal 9a1e9c327a Make byte stream functions set stream orientation.
When a byte-oriented stream function touches a stream, that stream
should be set to byte-oriented mode if it hasn't been set yet. If
it has been set, the opertion should only succeed if the stream is
already in byte-oriented mode.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-08 14:33:11 -07:00
Wren Turkal 746a86a267 Add unlocked variation of fwide function.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-08 14:33:11 -07:00
Wren Turkal b623e245c0 Make freopen reset the stream orientation.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-08 14:33:11 -07:00
Wren Turkal 865b7962a1 Add implmentation for fwide posix function.
This function is used to set the orientation of a stream to either
byte-oriented or wchar-oriented.

More info on this function is here:
https://man7.org/linux/man-pages/man3/fwide.3p.html

This implementation only impmlemnts the manual switching and does
not yet guard against using a byte-oriented stream with wchar
functions and vice versa. Those step will come in additional
commits.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-08 14:33:06 -07:00
jD91mZM2 56e1eceb28 Replace AllocStringWriter with CVec 2020-06-29 17:44:57 +02:00
oddcoder 92d6735e3f Add more scanf tests 2020-06-03 23:20:53 +02:00