Commit Graph

122 Commits

Author SHA1 Message Date
auronandace bf6dc24407 add ptr_offset_by_literal clippy lint and set to deny 2026-07-06 12:40:43 +01:00
Jeremy Soller 5f7a1a5c14 Merge branch 'casting-ascii' into 'master'
avoid as casting ascii bytes to c_char

See merge request redox-os/relibc!1457
2026-06-12 06:02:47 -06:00
auronandace ecb081d8bd add descriptions and pick a better function name 2026-06-12 11:13:06 +01:00
auronandace 4882c450d8 apply ByteLiteral abstraction 2026-06-11 18:01:25 +01:00
auronandace 40767a44fa avoid as casting ascii bytes to c_char 2026-06-11 15:06:06 +01:00
auronandace fd09491c4a apply ignored_unit_patterns clippy lint 2026-06-11 14:00:24 +01:00
auronandace 3603161a6f split out stdio constants for fcntl header 2026-06-04 14:09:38 +01:00
Jeremy Soller ffa097ccb3 Support nightly 2026-05-24 2026-05-25 17:03:17 -06:00
Wildan M 4a7f2d80ff Avoid StringWriter cast and string format 2026-05-20 09:10:25 +07:00
Connor-GH 7c8259dfd6 fix some lints caught by Clippy
Most of these changes are very simple. Among the changes made involve
taking advantage of auto-deref (`(*val).foo()` -> `val.foo()`) and
removing instances where we create a ref and immediately dereference it
(`&*val` -> `val`). There was a pretty neat case in `posix_openpt` where
some pointer verbosity was able to be reduced by using the more modern C
strings rather than the byte strings with an explicit NUL at the end.

Additionally, `exit()` now calls `unreachable!()` at the end. We
previously did `loop {}`, but clippy didn't like this. It can be up for
debate whether we want to make this `unreachable_unchecked` or similar.

There is only one change that might cause any sort of concern, and that
is the change from `.skip_while(!p).next()` -> `.find(p)`. This, like
everything else, was caught in a Clippy lint but I believe it deserves
some explanation because it isn't immediately obvious. Info about the
lint is here: https://rust-lang.github.io/rust-clippy/rust-1.89.0/index.html#skip_while_next
2026-04-30 19:02:35 -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
sourceturner 885118ccac add missing #[deprecated] annotations
add #[deprecated] annotation to functions that are marked
as 'legacy' or 'obsolecent' (according to their comments)
2026-04-20 21:37:52 +00:00
Nicolás Antinori 89f53e7640 Using Reader (formerly LookAheadReader) in scanf/wscanf format string 2026-04-14 14:11:57 -06:00
auronandace b4009544a8 minor code cleanups 2026-04-03 14:39:56 +01:00
auronandace 904604020b eliminate more range loops 2026-03-16 08:26:05 +00:00
auronandace b44bf78793 stdlib and stdio header cleanup 2026-02-28 19:01:06 +00:00
auronandace cefb9cccb9 stdio header cleanup 2026-02-24 19:45:09 +00:00
auronandace 768e28cb4e stdio and c_vec cleanup 2026-02-20 14:10:34 +00:00
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