rust-lang / libc

Raw bindings to platform APIs for Rust
https://docs.rs/libc
Apache License 2.0
2.1k stars 1.04k forks source link

Remove solarish compat for `openpty` and `forkpty` #4045

Open tgross35 opened 1 week ago

tgross35 commented 1 week ago

We currently polyfill these functions for solarish in https://github.com/rust-lang/libc/blob/3a0b0444d7206aa3feb30297c005597a960d0b33/src/unix/solarish/compat.rs, but it would be better to phase these out so we're not providing any implementations in libc.

It looks like Solaris supports openpty and forkpty https://docs.oracle.com/cd/E88353_01/html/E37843/openpty-3c.html, and Illumos has had them for at least a few years https://www.illumos.org/issues/5386, so at this point our implementation could be replaced with bindings.

devnexen commented 6 days ago

Correction, those are not available on illumos, either never been accepted or reverted ; most likely the former. As for solaris, only 11.4 supports these and 11.3 is supported until 2027. Might be best to keep the situation as is, if the solaris user really wants to use the native versions, it can always be declared easily, ie no need to map complicated struct or anything. Just my 2c :)

tgross35 commented 6 days ago

Oh that's interesting, thanks for the context. Hm, I'm not sure what to do here in that case - this is about the only case of polyfill in this crate and ideally we wouldn't have any. I guess maybe we can remove these with 1.0.