[swift-corelibs-dev] exit

Drew Crawford drew at sealedabstract.com
Thu Jan 14 10:44:58 CST 2016


on Darwin, we can say:

import Foundation
exit(2)

I'm not totally sure how this works, since exit is provided by Darwin, not by Foundation.  But somehow importing Foundation imports Darwin as well.

I think for source compatibility, we should support this, because people <http://stackoverflow.com/questions/34186994/swift-2-2-on-linux-use-of-unresolved-identifier-exit> are asking <http://stackoverflow.com/questions/24102157/seeking-an-exit-equivalent-in-swift> why it doesn't work out of the box.

I considered PRing an exit implementation in corelibs-foundation, but I think that might cause the opposite problem–introduce a conflict between Darwin/Glibc exit and Foundation "exit".

Can someone speak to how this is solved in Darwin Foundation and what we should do about it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20160114/c42dcf5c/attachment.html>


More information about the swift-corelibs-dev mailing list