Created
February 28, 2020 18:00
-
-
Save mlavergn/7fa08260681b24585d2a38f582963230 to your computer and use it in GitHub Desktop.
Swift C Direct Calls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// silgen allows you to call C functions without headers or bridges | |
// not to be used as a rulem but might have some interesting use cases | |
@_silgen_name("getpid") private func getpid() -> pid_t | |
print(getpid()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment