-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
gh-123797: Check for runtime availability of ptsname_r
on macos
#123806
Conversation
5be033a
to
9c7c710
Compare
9c7c710
to
3008727
Compare
Modules/posixmodule.c
Outdated
#else | ||
// unknown error: | ||
// both ptsname_r and ptsname are not available for some reason. | ||
ret = -1; |
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.
This is a "cannot happen" case: ptsname is available on all versions of macOS where configure detects ptsname_r.
I'd either drop drop the guard for the block above or replace this bit by an #error
.
(And regardless ret = -1
is wrong, the value should be an errno value such as ENOSYS
).
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.
Done, thanks for the review! 👍
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.
This is a "cannot happen" case: ptsname is available on all versions of macOS where configure detects ptsname_r.
Is there a macOS or iOS platform where ptsname() and ptsname_r() are not available?
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.
Is there a macOS or iOS platform where ptsname() and ptsname_r() are not available?
In short, no.
ptsname_r() is available on macOS 10.13.4 and iOS 11.3 (and later), ptsname() has been available from the start. Or at least, there are no availability annotations in Apple's headers which is a good indication that the API was available from the start.
When you're done making the requested changes, leave the comment: |
Done, thanks a lot, @vstinner, for the helpful suggestions! 👍 |
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
I will wait for @ronaldoussoren's feedback for a ~week and then merge 👍 |
One week has passed (why the time is so fast?), so I am merging this. |
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…os (pythonGH-123806) (cherry picked from commit 3e36e5a) Co-authored-by: sobolevn <mail@sobolevn.me>
GH-124270 is a backport of this pull request to the 3.13 branch. |
I took the version info from https://github.com/xybp888/iOS-SDKs/blob/d7f1be9f5b79cffcfb547bbd930f92ec0fc35038/iPhoneOS13.0.sdk/usr/include/stdlib.h#L224
ptsname_r
is not checked at runtime on macOS #123797