I’m trying to check system information in Swift. I figured out, that it could be achieved by code:
var sysData:CMutablePointer<utsname> = nil
let retVal:CInt = uname(sysData)
I have two problems with this code:
- What should be sysData’s initial value? This example gives -1 in retVal probably because sysData is nil.
- How can I read information from sysData?