relibc issueshttps://gitlab.redox-os.org/redox-os/relibc/-/issues2024-03-26T16:24:46Zhttps://gitlab.redox-os.org/redox-os/relibc/-/issues/192Implement posix_spawn2024-03-26T16:24:46ZJacob Lorentzon4ldo2@protonmail.comImplement posix_spawnSince Redox's `execv*` and `fork` implementations are based on the lower-level kernel context handles, it would be preferable to provide a custom implementation of `posix_spawn{,p}`, using those native APIs. The API in `redox-exec` alrea...Since Redox's `execv*` and `fork` implementations are based on the lower-level kernel context handles, it would be preferable to provide a custom implementation of `posix_spawn{,p}`, using those native APIs. The API in `redox-exec` already supports executing a remote process, which could be combined with the fork API, minus the copy-everything-and-then-reinitialize-everything parts.https://gitlab.redox-os.org/redox-os/relibc/-/issues/190Use a different format for passing argv/envp/auxv in execv2024-03-26T16:20:34ZJacob Lorentzon4ldo2@protonmail.comUse a different format for passing argv/envp/auxv in execvCurrently, Redox's execve implementation emulates Linux's format for passing the argv and envp pointers, and the auxiliary vectors, but this has several downsides. The current implementation does lots of mmap calls, which although it cou...Currently, Redox's execve implementation emulates Linux's format for passing the argv and envp pointers, and the auxiliary vectors, but this has several downsides. The current implementation does lots of mmap calls, which although it could be improved anyway, would be significantly easier with a simpler format. It also currently requires Redox-specific auxiliary vectors, which are passed null-terminated, which is true for envp too. The sigprocmask and "sigignmask" (POSIX requires execve to remember which signals were ignored, but otherwise reset them), as well as some internal relibc fds, would likely also need a custom auxv.
A simpler format would instead pass a header struct, providing the values the mandatory auxvs would otherwise provide, which might look like the following:
```rust
struct Header {
args_base: *const u8,
args_len: usize,
envs_base: *const u8,
envs_len: usize,
stack_top: *const u8,
stack_len: usize,
cwd_base: *const u8,
cwd_len: usize,
phnum: u16,
phentsize: u16,
page_size: u32,
phdr: u64,
procmask: u64, // set to "all blocked" until overridden by this value
ignmask: u64, // set to "all SIG_DFL" or "all SIG_IGN" until overridden by this value
interp_header: *const Header, // nullable
hwcap: u64,
}
```
It might also be possible for the args and envs to not be NUL-terminated, since relibc is forced to copy them anyway.https://gitlab.redox-os.org/redox-os/relibc/-/issues/185Add configuration instructions for Linux on the README2023-11-03T09:39:34ZRibbonAdd configuration instructions for Linux on the READMEWe need to document how to replace glibc with relibc on the build systems.
Goals:
- [ ] Add a Cargo example
- [ ] Add a Makefile example
- [ ] Add a CMake example
- [ ] Add a Meson exampleWe need to document how to replace glibc with relibc on the build systems.
Goals:
- [ ] Add a Cargo example
- [ ] Add a Makefile example
- [ ] Add a CMake example
- [ ] Add a Meson examplehttps://gitlab.redox-os.org/redox-os/relibc/-/issues/178Rustify2024-01-12T17:50:49ZRibbonRustifyThis issue covers the relibc parts that benefit from using a Rustier implementation, in order to be less prone to memory unsafety and to some extent logic bugs.
- [ ] [Rusty error handling](https://gitlab.redox-os.org/redox-os/relibc/-/...This issue covers the relibc parts that benefit from using a Rustier implementation, in order to be less prone to memory unsafety and to some extent logic bugs.
- [ ] [Rusty error handling](https://gitlab.redox-os.org/redox-os/relibc/-/issues/176)
- [ ] [Rust's libm port](https://gitlab.redox-os.org/redox-os/relibc/-/issues/154)
- [x] dlmallochttps://gitlab.redox-os.org/redox-os/relibc/-/issues/173Tracking issue for missing POSIX APIs2024-03-26T16:14:44ZJacob Lorentzon4ldo2@protonmail.comTracking issue for missing POSIX APIsWhile Redox's aim is not full POSIX compatibility, there are lots of missing APIs that generally only come with benefits.
Non-exhaustive list:
- [x] `wcsrtombs` (https://gitlab.redox-os.org/redox-os/relibc/-/issues/166)
- [x] `UTIME_OM...While Redox's aim is not full POSIX compatibility, there are lots of missing APIs that generally only come with benefits.
Non-exhaustive list:
- [x] `wcsrtombs` (https://gitlab.redox-os.org/redox-os/relibc/-/issues/166)
- [x] `UTIME_OMIT` and `UTIME_NOW` (https://gitlab.redox-os.org/redox-os/relibc/-/issues/172)
- [ ] `wait3` (no longer in POSIX?, https://gitlab.redox-os.org/redox-os/relibc/-/issues/170)
- [ ] `malloc.h` (not in POSIX?, https://gitlab.redox-os.org/redox-os/relibc/-/issues/136)
- [x] `towctrans` and `wctrans` (https://gitlab.redox-os.org/redox-os/relibc/-/issues/32)
- [ ] some `sys/mman.h` defs (https://gitlab.redox-os.org/redox-os/relibc/-/issues/73)
- [x] some networking constants (https://gitlab.redox-os.org/redox-os/relibc/-/issues/164)
- [ ] `mknod` (https://gitlab.redox-os.org/redox-os/relibc/-/issues/103)
- [x] `swprintf`
- [ ] `swscanf`
- [x] `ungetwc`
- [x] `vfwprintf`
- [x] `vwprintf`
- [x] `vswprintf`
- [ ] `wcsftime`
- [ ] `wcswcs`
- [ ] `wcsxfrm`
- [x] `wprintf`
- [ ] `wscanf`
Not all POSIX APIs are available as stubs, but those that are, can be found by looking for commented-out `#[no_mangle]`, e.g. via `rg '^.*//.*#\[no_mangle\]'`.
There are some POSIX requirements that will be much harder to fix. First, the current context=process=thread assumption must be dealt with. Second, POSIX appears to allow all characters but NUL and '/', which conflicts with how schemes work (even returning an error due to lack of support for : in the filesystem, doesn't apply, as it will work but the behavior will be different).
### Implementation
Almost all POSIX functions are well-documented on https://pubs.opengroup.org. Another good reference is [cppreference.com](https://en.cppreference.com/w/c).https://gitlab.redox-os.org/redox-os/relibc/-/issues/152Enhance Documentation/Readme2019-09-22T13:36:09ZJonathan KlimtEnhance Documentation/ReadmeHi,
I'm very excited to try out relibc with C code, but the README does not quite help me with that.
It would be great, if the README would contain some information on these topics:
- How to build/install relibc (apparently using the m...Hi,
I'm very excited to try out relibc with C code, but the README does not quite help me with that.
It would be great, if the README would contain some information on these topics:
- How to build/install relibc (apparently using the makefile)
- How to use relibc in Rust
- How to use relibc with C
Best regards
Jonathanhttps://gitlab.redox-os.org/redox-os/relibc/-/issues/101signal: Implement sigaction2023-02-26T10:24:25ZDan Robertsonsignal: Implement sigaction`sigaction` is not currently implemented, and is needed for implementing `signal` etc.
- [x] Implement basic wrappers for the `sigaction` syscall for linux and redox in the `platform` crate.
- [ ] Implement `restorer` for linux. (It loo...`sigaction` is not currently implemented, and is needed for implementing `signal` etc.
- [x] Implement basic wrappers for the `sigaction` syscall for linux and redox in the `platform` crate.
- [ ] Implement `restorer` for linux. (It looks like [redox-os/syscall] already implements `sigrestore`)
- [ ] Implement `sigaction` in the `signal` crate.
[redox-os/syscall]: https://github.com/redox-os/syscallhttps://gitlab.redox-os.org/redox-os/relibc/-/issues/79Create cargo-fuzz targets2018-06-13T19:39:51ZDan RobertsonCreate cargo-fuzz targetsCreate [cargo-fuzz] targets for relevant functions. It would be particularly easy to create a fuzzer target for some of the functions in the [string] crate.
[cargo-fuzz]: https://github.com/rust-fuzz/cargo-fuzz
[string]: https://gith...Create [cargo-fuzz] targets for relevant functions. It would be particularly easy to create a fuzzer target for some of the functions in the [string] crate.
[cargo-fuzz]: https://github.com/rust-fuzz/cargo-fuzz
[string]: https://github.com/redox-os/relibc/tree/master/src/string