How do I pass a series of program arguments to the...
# kotlin-native
n
How do I pass a series of program arguments to the posix_spawn function ( https://man7.org/linux/man-pages/man3/posix_spawn.3.html ; using argv parameter )? I have tried the toCStringArray function ( https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.cinterop/to-c-string-array.html ) trick but that isn't working as expected. Reading from the child process's output stream results in an infinite loop occurring. The child process is a Kotlin Native program that prints out the program arguments (via stdout).
Turns out the absolute path to the program needs to be the first element in the array, otherwise strange behaviour will occur when spawning the process.