MacOS: fix CPU detection, OS version and bitness#125
MacOS: fix CPU detection, OS version and bitness#125barracuda156 wants to merge 3 commits intolfreist:mainfrom
Conversation
| _kernel = utils::getSysctlString("kern.ostype", "<unknown name> "); | ||
| _kernel.pop_back(); | ||
| _kernel = _kernel + " " + utils::getSysctlString("kern.osrelease", "<unknown version> "); | ||
| _kernel.pop_back(); |
There was a problem hiding this comment.
There was a problem hiding this comment.
Hmm, they seem to have broken output on Sonoma for me. I will try putting them back and see if the same error shows up.
P. S. Is this behavior of sysctl documented or is it a bug? I do not think this should happen or this normally happens.
There was a problem hiding this comment.
This is probably the null terminator. This is C-specific - all char arrays must end with a null-terminator
Since the getSysctlString() function simply reads the whole thing, that terminator stays. I guess we could think about just reading the length of the buffer -1 in the function itself instead of manually popping that character.
There was a problem hiding this comment.
Im not certain about this though. It's a guess

@lfreist @Shieldine Hopefully this fixes a part of current issues. RAM detection is still broken.
10.6 PowerPC:
14.7 arm64: