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/188[Feature Request]Ignore negative fd in poll(2)2024-03-26T16:21:12ZSteve Lau[Feature Request]Ignore negative fd in poll(2)Requested by [nix-rust/nix#2254](https://github.com/nix-rust/nix/issues/2254), I would like to have `poll(2)` ignore the `pollfd`s that have a negative file descriptor
This is not specified in the POSIX spec, but almost all the OSes hav...Requested by [nix-rust/nix#2254](https://github.com/nix-rust/nix/issues/2254), I would like to have `poll(2)` ignore the `pollfd`s that have a negative file descriptor
This is not specified in the POSIX spec, but almost all the OSes have this feature implemented:
| OS | Supported |
|---------|------------|
|darwin |Yes|
| linux |Yes|
|android |Probably yes|
| freebsd |Yes|
|dragonfly|Yes|
|netbsd |Yes|
|openbsd |Yes|
|illumos |Yes|
|solaris |Yes|
|haiku |Yes|
|redox |No|https://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/176Rusty error handling2023-11-12T15:41:15ZJacob Lorentzon4ldo2@protonmail.comRusty error handlingCurrently, relibc primarily does C-like error handling (returning -1 and setting errno). A better alternative would be to use `Result<T, Errno>`, which AFAIK currently only the inner pthread implementation does. If `Errno` is defined as ...Currently, relibc primarily does C-like error handling (returning -1 and setting errno). A better alternative would be to use `Result<T, Errno>`, which AFAIK currently only the inner pthread implementation does. If `Errno` is defined as `NonZeroU32`, then the common "zero for success or -1 with errno" can be represented zero-cost as `Result<(), Errno>`. Only the outer C functions would convert the inner OS-abstracted platform functions into "-1 and errno", or other types of error handling (such as pthread's "0 or error code").
Worth noting both Redox and Linux represent syscall errors as negative error numbers (in Linux's case, between -4096 and -1, and currently in Redox's case, all negative numbers), so this change would most likely not lead to performance degradation.https://gitlab.redox-os.org/redox-os/relibc/-/issues/174Use corresponding syscalls for {p,}{read,write}{v,}2024-03-26T16:19:51ZJacob Lorentzon4ldo2@protonmail.comUse corresponding syscalls for {p,}{read,write}{v,}Currently, only read and write, out of read/pread/readv/preadv/preadv2 and write/pwrite/writev/pwritev/pwritev2, are part of the platform abstraction trait. On Linux, adding missing syscall wrappers for this would be relatively easy, and...Currently, only read and write, out of read/pread/readv/preadv/preadv2 and write/pwrite/writev/pwritev/pwritev2, are part of the platform abstraction trait. On Linux, adding missing syscall wrappers for this would be relatively easy, and Redox will likely get support for them soon (only preadv2 and pwritev2 as they are the superset of all the other ones).https://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/170wait4/wait3 support2024-01-06T23:56:29ZLuca Barbatowait4/wait3 supportRecently I started to look into ways to get the resource information reliably and ~~`wait4()`~~/`wait3()` seem to work better than `getrusage()`. Does redox have a similar facility to leverage?Recently I started to look into ways to get the resource information reliably and ~~`wait4()`~~/`wait3()` seem to work better than `getrusage()`. Does redox have a similar facility to leverage?https://gitlab.redox-os.org/redox-os/relibc/-/issues/167Reduce dependencies by replacing goblin with object2023-02-26T11:17:02ZYonggang LuoReduce dependencies by replacing goblin with objectHow about using object instead goblin in relibc, as in rust runtime, the backtrace component already using object instead goblin because of it's less dependencies.How about using object instead goblin in relibc, as in rust runtime, the backtrace component already using object instead goblin because of it's less dependencies.https://gitlab.redox-os.org/redox-os/relibc/-/issues/183WASM WASI compatibility2023-10-21T20:12:15ZDaniel OlanoWASM WASI compatibilityHello! Just wanted to bring some discussion about this topic.
There is this big fancy train call WASM that will surely get far and seems to me that people jumping on board might benefit form its momentum. And what better that a new fre...Hello! Just wanted to bring some discussion about this topic.
There is this big fancy train call WASM that will surely get far and seems to me that people jumping on board might benefit form its momentum. And what better that a new fresh, secure and lightweight OS? It might be already to late to make Redox completely Web Assembly centric but some adaptations could be made to make it play better with wasm apps using the Web Assembly System Interface? The plan of WASI is to have a modular set of non web system APIs so WASM apps can run outside of the web in a secure way, currently they started with the [core API system calls](https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md) to implement basic IO functionality.
I don't know much about anything but in my simple way to see things I would seem that if Redox syscalls heppen to be the same as WASI and a WASM app targeting this kind of runtime is run using a JIT compiler built-in or compiled ahead of time at "installation" time, the app just "just work"? What do you guys think about being more web assembly friendly? does it deviate too much from the design choices of Redox? ultimately I just want to see this project to succeed, been a patreon for some time and see an opportunity there to gain back momentum that has been lost over time. :sweat\_smile:
As web technologies supporter I would definitely be very exited to see a WASM centric OS whether is Redox based or not, WASI runtimes will be popular and Operating systems built around it will be used, for sure there will be linux distros just for that that will see a big success in the cloud for example but I rather see Redox there ;) on the plus side all this wasm stuff compilers and runtimes are being written in Rust so they would integrate much nicely with Redox than with any other OS.
What do you think? makes some sense?https://gitlab.redox-os.org/redox-os/relibc/-/issues/154Consider using Rust's libm port2023-07-13T14:06:45ZMateusz MikułaConsider using Rust's libm portLink: https://github.com/rust-lang-nursery/libmLink: https://github.com/rust-lang-nursery/libmhttps://gitlab.redox-os.org/redox-os/relibc/-/issues/124FreeBSD/macOS Support2023-07-17T12:04:59ZJeremy SollerFreeBSD/macOS Support*Created by: Arcterus*
`sc` seems to support both, so I don’t think it would be _too_ difficult to add support for them.*Created by: Arcterus*
`sc` seems to support both, so I don’t think it would be _too_ difficult to add support for them.