christophsturm
03/22/2022, 2:09 PMephemient
03/22/2022, 2:15 PMval p = ProcessBuilder("uname", "-p").redirectOutput(PIPE).start()
val arch = p.inputStream().use { it.bufferedReader().readText() }
check(p.waitFor() == 0)
christophsturm
03/22/2022, 2:19 PMchristophsturm
03/22/2022, 2:19 PMephemient
03/22/2022, 3:15 PMuname
on Linux, https://manpages.debian.org/setarch.8. I'm not sure there's any reasonable way to detect that from within the JVMkqr
03/22/2022, 6:07 PMunknown
馃檪ephemient
03/22/2022, 6:18 PMuname -m
? the meaning of the different fields does vary a bit between UNIXenFleshgrinder
03/24/2022, 6:44 AM-m
is usually better and gives a more meaningful result also on BSD (Mac).christophsturm
03/24/2022, 10:29 AMchristophsturm
03/24/2022, 10:29 AMchristophsturm
03/24/2022, 10:30 AM~ 位 /bin/zsh -c 'sysctl -n machdep.cpu.brand_string'
Apple M1 Pro
~ 位 arch -x86_64 /bin/zsh -c 'sysctl -n machdep.cpu.brand_string'
Apple M1 Pro
christophsturm
03/24/2022, 10:32 AMuname -v
arch -x86_64 uname -v
Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000
christophsturm
03/24/2022, 10:37 AMfun main() {
val p = ProcessBuilder("uname", "-v").redirectOutput(PIPE).start()
val uname = p.inputStream.use { it.bufferedReader().readText() }
check(p.waitFor() == 0)
println(uname.contains("ARM64"))
}