-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Added POSIXErrorCode for Linux #3655
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
Conversation
@colemancda Thank you! Could you describe the procedure through which you obtained this mapping? (E.g., manually examined the header files, used a tool, used the C preprocessor etc.) |
@gribozavr Manually from C headers. I used this website http://www.virtsync.com/c-error-codes-include-errno |
Can this be rebased so we don't have a commit and revert of a new value type in the history? |
@parkera Done. |
Thanks! |
@parkera Can this be tested and merged? |
I'll let @gribozavr merge this one, but I'll kick off a test. |
@swift-ci please test |
@parkera Can we test again? I think something is wrong with the CI. |
@swift-ci please test. |
Though this has passed I have serious reservations about the canonicity and correctness of the source involved in generating these constants. Can you please add an executable to the |
@@ -1,254 +1,466 @@ | |||
// FIXME: Only defining POSIXErrorCode for Darwin at the moment. |
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 entire file is not formatted correctly. Could you please
- Use 2-space indentation
- Align top-level declarations without any leading whitespace.
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 point still stands.
// UNSUPPORTED: OS=watchos | ||
// UNSUPPORTED: OS=linux-androideabi | ||
|
||
// REQUIRES: OS=linux-gnu |
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 test can probably be generalized to more platforms with minimal changes. Could you look into making it cross platform?
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.
Sure. It will just take a while for all the error codes. There are more on Linux than on OS X. I think only the first 35 are actually POSIX.
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.
You can remove the UNSUPPORTED clauses as long as you have REQUIRES.
Done: - Renamed test case - Made test case cross-platform - Applied proper formatting for POSIXErrorCode.swift Pending: - Finish test case for Darwin and Linux with all error codes
/// Interface output queue is full. | ||
case EQFULL = 106 | ||
/// Must be equal largest errno. | ||
public static var ELAST: POSIXErrorCode { return EQFULL } | ||
|
||
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.
Could you revert the whitespace changes from the diffs above?
@CodaFi Can you please re-review this? |
@colemancda Do you mind rebasing this and fixing the conflict? |
The old comments still stand. If @colemancda prefers, I can rebase onto this and tidy it up myself. |
@CodaFi Could you please? Sorry I've been very busy at work. Thanks! |
No trouble at all. Thanks for putting in the initial patch. |
This patch is superseded by the merge of #6707. |
Removed
// FIXME: Only defining POSIXErrorCode for Darwin at the moment.