Hi all! I'm just starting to play around with Kot...
# kotlin-native
a
Hi all! I'm just starting to play around with Kotlin Native for a command line utility tool. I'm trying to figure out how to make a
fork
system call but I don't think the
fork
function is available. However, I see it being mentioned in the below SO posts. Is there something I'm missing? https://stackoverflow.com/questions/57190228/using-kotlin-native-how-can-i-execute-an-external-os-executable-or-path-comman https://stackoverflow.com/questions/51460921/kotlin-native-execute-an-executable
a
Hello, @Ardian! This function should be presented in posix platform library, try
import platform.posix.fork
a
Hi @Artyom Degtyarev [JB], I tried that but I'm getting error:
Copy code
Unresolved reference: fork
a
Okay, let me ask you some additional questions. What is your Kotlin version, and what platform are you targeting here?
a
kotlin 1.3.72 and I'm targeting mingwX64 (Windows)
a
I see. No, I’m afraid platform libraries for mingw target don’t have a fork, as it is not across the headers.
a
Ah... I guess that explains why then. Well, thanks for your help!
n
Ardian - If you were using a Unix based Kotlin Native target like linuxX64 then the fork function should be available (aka an import away).
a
Hi @napperley! This tool I'm building is intended for Windows users.
🆗 1