Skip to content

[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

Closed
wants to merge 5 commits into from

Conversation

colemancda
Copy link
Contributor

Removed
// FIXME: Only defining POSIXErrorCode for Darwin at the moment.

@colemancda colemancda changed the title Added POSIXErrorCode for Linux [stdlib] Added POSIXErrorCode for Linux Jul 21, 2016
@gribozavr
Copy link
Contributor

@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.)

@colemancda
Copy link
Contributor Author

@gribozavr Manually from C headers. I used this website http://www.virtsync.com/c-error-codes-include-errno

@parkera
Copy link
Contributor

parkera commented Jul 21, 2016

Can this be rebased so we don't have a commit and revert of a new value type in the history?

@colemancda
Copy link
Contributor Author

@parkera Done.

@parkera
Copy link
Contributor

parkera commented Jul 24, 2016

Thanks!

@colemancda
Copy link
Contributor Author

@parkera Can this be tested and merged?

@parkera
Copy link
Contributor

parkera commented Jul 26, 2016

I'll let @gribozavr merge this one, but I'll kick off a test.

@parkera
Copy link
Contributor

parkera commented Jul 26, 2016

@swift-ci please test

@colemancda
Copy link
Contributor Author

@parkera Can we test again? I think something is wrong with the CI.

screen shot 2016-07-30 at 12 41 09 am

@CodaFi
Copy link
Contributor

CodaFi commented Jul 31, 2016

@swift-ci please test.

@CodaFi
Copy link
Contributor

CodaFi commented Jul 31, 2016

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 validation-test directory that cross-checks these constants with the operating system?

@@ -1,254 +1,466 @@
// FIXME: Only defining POSIXErrorCode for Darwin at the moment.
Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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 }

Copy link
Contributor

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?

@slavapestov
Copy link
Contributor

@CodaFi Can you please re-review this?

@slavapestov
Copy link
Contributor

@colemancda Do you mind rebasing this and fixing the conflict?

@CodaFi
Copy link
Contributor

CodaFi commented Jan 10, 2017

The old comments still stand. If @colemancda prefers, I can rebase onto this and tidy it up myself.

@colemancda
Copy link
Contributor Author

@CodaFi Could you please? Sorry I've been very busy at work. Thanks!

@CodaFi
Copy link
Contributor

CodaFi commented Jan 10, 2017

No trouble at all. Thanks for putting in the initial patch.

@CodaFi
Copy link
Contributor

CodaFi commented Jan 11, 2017

This patch is superseded by the merge of #6707.

@CodaFi CodaFi closed this Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants