Commit Graph

113 Commits

Author SHA1 Message Date
Peter Limkilde Svendsen 5116c80d2f Reorder functions alphabetically 2025-02-01 17:34:20 +01:00
Peter Limkilde Svendsen bfde89c7cc Add docs and deprecations for unistd.h 2025-02-01 17:23:36 +01:00
Ron Williams c528c0885f Make nanosleep and sleep handle interrupts correctly, plus fix alarm 2025-01-31 21:10:14 +00: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 ce7b85b0df Merge branch 'dont-overallocate-cstrings' into 'master'
Avoid over allocations & reallocations

See merge request redox-os/relibc!558
2024-11-17 16:17:22 +00:00
Josh Megnauth 5348273ccc Emit C attributes via cbindgen 2024-11-17 16:15:07 +00:00
Josh Megnauth d6ac5f8947 Avoid over allocations & reallocations
As we know, vectors amortize the cost of adding new elements by reserving
space for multiple elements when full. This is useful but may lead to
allocating more memory than necessary.

`relibc` generally avoids over allocations by reserving the exact amount
of space when possible. I fixed a few areas that still over allocated or
reallocated unnecessarily by leveraging iterators that are more likely
to know sizes.
2024-11-14 22:53:12 -05:00
Dorian Davi efcbbb8592 Add C code necessary for libuv to work 2024-10-24 16:58:52 +00: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 986754e7b3 Remove all remaining errno interfaces from Pal. 2024-09-27 10:29:32 +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
Kamil Koczurek 408a7b2ab6 Add capability to set the default scheme 2024-09-23 14:36:45 +00:00
Jeremy Soller 1ac8c4834b Format 2024-09-19 16:09:11 -06:00
Jeremy Soller 7371cbcab0 unistd: implement daemon function 2024-09-19 14:59:04 -06:00
4lDO2 0ded9780f1 Use multiline string in unistd config. 2024-09-14 00:49:08 +02:00
Jeremy Soller 0b03a68150 Fix unistd header generation 2024-09-11 15:59:31 -06: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
4lDO2 4bd0d2a1ef Move pthread::Errno to separate module. 2024-09-11 23:22:29 +02:00
Agoston Szepessy b5f767ea30 More PR feedback
Use u8 internally instead of `c_char`.
2024-07-23 18:07:09 +02:00
Agoston Szepessy 99ade44c12 PR feedback
- Remove `stdio` functions and use `File` API completely.
- Remove `unsafe` from wrapper function.
- Move static buffer to `getpass()` instead of keeping it in wrapper.
2024-07-23 16:56:39 +02:00
Agoston Szepessy 545e9e7b29 Implement getpass using File API
Returns a Result for better error handling.
2024-07-23 16:07:25 +02:00
Agoston Szepessy a83d4cbced Implement getpass()
Also make fields in `termios` public; required for modifying them.

There's an new type of test: `EXPECT_INPUT_BINS`. These require a `.exp`
file to be present along with the `.c` file. The `.exp` file takes the
produced binary as an argument and sends input to the program. This is
useful for testing functions like `getpass()`.
2024-07-23 16:07:25 +02:00
4lDO2 bf26de70e2 Add setresuid/setresgid (suid/sgid stub on Redox). 2024-07-18 23:54:46 +02:00
4lDO2 4c11b607de Implement pread and pwrite using the syscalls. 2024-06-14 14:10:47 +02:00
Jacob Lorentzon e0b640d530 Implement new low-level signal trampoline 2024-03-17 16:58:42 +00:00
Jeremy Soller d3aac3585c Merge branch 'errno-naming' into 'master'
Use standard casing and mangling for internal errno

See merge request redox-os/relibc!457
2024-03-01 00:25:42 +00:00
Peter Limkilde Svendsen a7137512fa Use standard casing and mangling for internal errno 2024-03-01 00:25:42 +00:00
Jeremy Soller 4f8d16a3b9 Merge branch 'crypt' into 'master'
Add Crypt functions

See merge request redox-os/relibc!453
2024-03-01 00:23:42 +00:00
Darley Barreto 55dc2019f2 Add Crypt functions 2024-03-01 00:23:42 +00:00
Peter Limkilde Svendsen 9093f6bc47 Use Cell representation for errno 2024-02-29 14:07:40 +00:00
Peter Limkilde Svendsen aea9e2b432 Panic when getpagesize() cannot succeed as specified 2024-02-19 00:19:03 +00:00
Jeremy Soller a2321e4b2b Add initgroups 2024-01-16 20:00:57 -07:00
4lDO2 5630b6e0df Make relibc (except libm) pure Rust 2024-01-11 13:08:06 +00:00
Jeremy Soller 635248cdff Define _SC_GETGR_R_SIZE_MAX 2023-09-13 11:26:44 -06:00
Jeremy Soller afdc26f9cc Add getgroups/setgroups (stub on redox) 2023-09-13 11:16:59 -06: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
David Carlier 5041df0015 setsid implementation 2023-05-04 19:09:32 +01:00
David Carlier eb87e2b796 fix no_mangle annotation missing 2023-04-26 19:42:29 +01:00
Jeremy Soller 8a002ecc1d Merge branch 'sync_impl' into 'master'
sync implementation

See merge request redox-os/relibc!375
2023-04-26 18:24:48 +00:00
David Carlier a561e682a3 sync implementation 2023-04-22 13:20:18 +01:00
David Carlier 3456b4f30e unistd: fdatasync implementation. 2023-04-19 21:48:54 +01:00
David Carlier 66786f619d unistd: getdtablesize implementation proposal 2023-04-11 20:45:02 +01:00
David Carlier 637dd22d3d stdio: implements legacy cuserid proposal. 2023-04-05 22:17:09 +01:00
Jeremy Soller 59b2e32953 Fix compilation on 32-bit systems 2022-12-02 08:00:36 -07:00
Jeremy Soller 9e0c53f222 Make long 32-bits on 32-bit systems 2022-12-01 18:33:00 -07:00
Jeremy Soller b30c33adc3 Add getsid stub 2022-10-17 11:37:58 -06:00