How do I call `platform.darwin.sysctlbyname` corre...
# kotlin-native
n
How do I call
platform.darwin.sysctlbyname
correctly? What I don’t know is how to form
arg2
correctly. I’m doing the following:
Copy code
var size: ULong = 0u
sysctlbyname("hw.machine", null, cValuesOf(size), null, 0)
but I get a warning from the compiler that
size
can be declared as
val
since its value won’t change, but that’s what I expect, the function should return the size of the value, so size shouldn’t be
0
. So what is the proper way to call this function?