-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solarish: Restrict openpty and forkpty polyfills to illumos, replace Solaris implementation with FFI #4329
solarish: Restrict openpty and forkpty polyfills to illumos, replace Solaris implementation with FFI #4329
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
illumos still relies on these implementations. If you've confirmed that they are not necessary for Solaris (in which case wouldn't defining them as FFI symbols be necessary?), you should put them behind a cfg(illumos)
guard rather than outright removing them.
Yes my bad, I’ll update it right away. Thanks! |
src/unix/solarish/compat.rs
Outdated
#[cfg(not(target_os = "illumos"))] | ||
extern "C" { | ||
pub fn openpty( | ||
amain: *mut c_int, | ||
asubord: *mut c_int, | ||
name: *mut c_char, | ||
termp: *const crate::termios, | ||
winp: *const crate::winsize, | ||
) -> c_int; | ||
|
||
pub fn forkpty( | ||
amain: *mut c_int, | ||
name: *mut c_char, | ||
termp: *const crate::termios, | ||
winp: *const crate::winsize, | ||
) -> crate::pid_t; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should go in solaris.rs
, where they don't require the guard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, Thanks!
@psumbera would you mind double checking this for Solaris? |
As can be seen from failed CI test. Solaris don't define these with 'const`. So it's just:
|
Updated, thanks for the help! cc @tgross35 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please rebase and squash. Also the title & PR description should be updated.
@rustbot label +stable-nominated
openpty
and forkpty
polyfill implementationsa957ede
to
8909387
Compare
Sorry, could you also update the commit message? It is also out of date (and GH doesn't let me edit that with the merge queue UI) |
8909387
to
a67d297
Compare
…Solaris implementation with FFI
a67d297
to
e9d29ec
Compare
Thanks! |
…Solaris implementation with FFI (backport <rust-lang#4329>) (cherry picked from commit e9d29ec)
Description
This PR modifies the openpty and forkpty implementations in the Solarish layer:
Related to Remove solarish compat for
openpty
andforkpty
#4045Sources
openpty
andforkpty
#4045Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI