Skip to content
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

Proposal to expose fcntl() API as part of the Swift stdlib. #38

Closed
wants to merge 5 commits into from

Conversation

billabt
Copy link

@billabt billabt commented Dec 7, 2015

Previously discussed on the Swift Evolution forum.


## Introduction

At the present time Swift does not support the calling of variadic / va_list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swift does support va_list functions, it only does not support variadic ones.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll fix the proposal… Thanks.

-Bill

On Dec 7, 2015, at 12:52 PM, Dmitri Gribenko notifications@github.com wrote:

In proposals/fcntl-additions-to-stdlib.md #38 (comment):

@@ -0,0 +1,68 @@
+# Expose fcntl() API as part of the Swift stdlib
+
+* Proposal: [SE-NNNN]
+* Author(s): Bill Abt
+* Status: Review
+* Review manager: TBD
+
+## Introduction
+
+At the present time Swift does not support the calling of variadic / va_list
Swift does support va_list functions, it only does not support variadic ones.


Reply to this email directly or view it on GitHub https://github.com/apple/swift-evolution/pull/38/files#r46852344.

@manavgabhawala
Copy link
Contributor

I think this is more of an implementation detail rather than a proposal to change the language. I am sure if you made this change to the swift std lib directly and made a pull request with the changes that they would be accepted even without any talks in swift evolution. I think everyone can agree exposing C functions better to swift is a good thing so there isn't really a need to discuss it in swift evolution.

@gribozavr
Copy link
Contributor

@manavgabhawala Every change to the library API need to go through the evolution process.

@billabt
Copy link
Author

billabt commented Dec 7, 2015

@gribozavr I totally agree. There can be side effects and who knows what as a result of adding things to the library without any sort of prior discussion. It doesn’t take long to write up a proposal nor does it do any harm if folks discuss it…

-Bill

On Dec 7, 2015, at 2:28 PM, Dmitri Gribenko notifications@github.com wrote:

@manavgabhawala https://github.com/manavgabhawala Every change to the library API need to go through the evolution process.


Reply to this email directly or view it on GitHub #38 (comment).

@ddunbar
Copy link
Contributor

ddunbar commented Dec 10, 2015

I feel like it might be worth having an exception if the new code just adds Glibc support for the same APIs as we already support on Darwin. That is an important thing to call out on any patch to the overlays, in any case.

@billabt
Copy link
Author

billabt commented Dec 10, 2015

In this case, it’s a combination. fcntl() is currently not supported in either Darwin or Glibc. open(), open() and see_open() are already in Darwin but not Glibc. In the PR that I did that contains the implementation (swiftlang/swift#196 swiftlang/swift#196) you’ll see the last three are straight ports from the Darwin implementation. The fcntl() implementation is entirely new and includes a full battery of test cases. So this is basically a hybrid and should probably go thru swift-evolution. Thoughts?

On Dec 10, 2015, at 1:05 PM, Daniel Dunbar notifications@github.com wrote:

I feel like it might be worth having an exception if the new code just adds Glibc support for the same APIs as we already support on Darwin. That is an important thing to call out on any patch to the overlays, in any case.


Reply to this email directly or view it on GitHub #38 (comment).

@lattner
Copy link
Collaborator

lattner commented Dec 10, 2015

Daniel, I agree with you - there is nothing to design/review on that case, it is simply a parity issue. I'll bring this up with Doug even though it doesn't relate to this specific case.

@DougGregor
Copy link
Member

Sorry for the back-and-forth here; I think this can just be handled as a fix to the Darwin and Glibc overlays, because it is working around a compiler limitation (inability to importer variadic C functions) to expose the same API one would get from POSIX.

@DougGregor DougGregor closed this Dec 11, 2015
@lattner
Copy link
Collaborator

lattner commented Dec 11, 2015

Bill, I'm sorry for the delay on this - we're all still learning how to do things.

@billabt
Copy link
Author

billabt commented Dec 11, 2015

No problem. I completely understand. So am I. Just ask Dmitri. 😃

On Dec 10, 2015, at 8:26 PM, Chris Lattner notifications@github.com wrote:

Bill, I'm sorry for the delay on this - we're all still learning how to do things.


Reply to this email directly or view it on GitHub #38 (comment).

ktoso pushed a commit to ktoso/swift-evolution that referenced this pull request Mar 3, 2021
[Actors] Reentrancy discussion and proposal
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.

6 participants