<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Yes, I closed the original PR and created a new one that consolidates the changes into a single commit. Dmitri just reviewed it and asked me to make a few formatting changes. I’ve just completed them and am doing a build on both OS X and Linux. When that’s complete, I’ve written a small Swift test program that I’ll compile with the newly built compiler. Assuming all goes well, I’ll push these last set of changes and it should be good to go.</div><div class=""><br class=""></div><div class="">-Bill</div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 10, 2015, at 8:17 PM, Ted Kremenek <<a href="mailto:kremenek@apple.com" class="">kremenek@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I agree Chris’s points here.</div><div class=""><br class=""></div><div class="">One of the original reasons the SDK Overlay was conceived was to help massage the interface between C APIs (such as ones using variadics) and Swift. This seems right in that category. I think for changes like this all that is needed is a code owner to review these changes. I don’t think this needs to go through the swift-evolution process unless it is a major API change.</div><div class=""><br class=""></div><div class=""><b class="">Bill:</b> do you still have a pull request handy for this change?</div><div class=""><br class=""></div><div class="">Ted</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 5, 2015, at 11:11 PM, Chris Lattner via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Dec 4, 2015, at 8:36 PM, Bill Abt <<a href="mailto:babt@me.com" class="">babt@me.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">The fcntl() API is a variadic standard “C” library and as such not supported currently by Swift. Any visit to GitHub looking for a socket implementation will invariably find a .c or .mm file included that exposes fcntl() to Swift via a shim. There are only 3 forms of this API, all returning int. The first takes 2 integers and sets the 3rd to 0. The second takes 3 integers. The last and final form take 2 integers and a void pointer. Looking at the standard library source, it’s trivial to implement. It’ll take longer to write the tests than it will to write the functions. Once implemented, it would eliminate the need for shims for this API.</div><div class=""><br class=""></div><div class="">This seems like one of those obvious things that just haven’t been implemented yet, no?</div></div></div></blockquote><div class=""><br class=""></div><div class="">Hi Bill,</div><div class=""><br class=""></div><div class="">The Swift standard library doesn’t provide this sort of functionality, but I agree that it makes sense for the Darwin/Glibc modules to provide this interface. We have a system of “overlays” to provide functionality that the clang importer can’t do automatically. For example, the Glibc overlay is here:</div><div class=""><a href="https://github.com/apple/swift/blob/master/stdlib/public/Glibc/Glibc.swift" class="">https://github.com/apple/swift/blob/master/stdlib/public/Glibc/Glibc.swift</a></div><div class=""><br class=""></div><div class="">The darwin overlay is more filled out:</div><div class=""><a href="https://github.com/apple/swift/blob/master/stdlib/public/SDK/Darwin/Darwin.swift" class="">https://github.com/apple/swift/blob/master/stdlib/public/SDK/Darwin/Darwin.swift</a></div><div class=""><br class=""></div><div class="">It doesn’t look like it provides fcntl specifically, but it does provide open, which has the same varargs sort of implementation issues. Adding support for fcntl to the overlays makes sense in principle to me.</div><div class=""><br class=""></div><div class="">-Chris</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=cUTXn2XUQg0NGOEWHTVTyDr9W6Is2djHPo9bUJUJ-2FRaXISV0u-2F6x4A3gqTRovGsWB3NkuM-2FFXtgz-2BawsNPatNmEaxf-2FquCMvzpDT-2F1T7vsS1VS2fvG3nweaOn5-2BuYlcC2vP8je9fKYYX10YQBZ6PTNIs9sbJxUtm4FxwMy2ImdxSc2kAEhUGhlQZfXPUk7QnIGvUKD7Wv-2FzLrYXZrLHHRI4YC5-2BQ-2Bxn9MS3ysyx6GqQ-3D" alt="" width="1" height="1" border="0" style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""></span><span style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: MyriadSet-Thin; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></body></html>