Also, make nativeUname() use /proc/sys/kernel/{ostype,hostname,osrelease,version} files and uname -m for architecture instead. (Not strictly necessary, just thought that'd be better, I think the previous method of guessing _UTSNAME_LENGTH, was nice, but maybe a bit hacky :p )
Make CpuArch._internal() use dart:ffi Abi for architecture detection, too now, instead of querying uname.
You could also remove the whole cpu_architecture.dart file since people should really be using dart:ffi's Abi class :) But that'd be a breaking change of course.
Thanks for your submission. I will include these changes for the next relaase 0.9.6. For this release I will update the https://github.com/vsergeev/c-periphery libs. After two years an update is available.
Hey, thanks for the project! It's really helpful!
dart:ffi
has it's ownAbi
class now, which you can use for architecture detection: https://api.dart.dev/stable/2.18.1/dart-ffi/Abi-class.html. It's used internally for@AbiSpecificInteger
for example.Also, make
nativeUname()
use/proc/sys/kernel/{ostype,hostname,osrelease,version}
files anduname -m
for architecture instead. (Not strictly necessary, just thought that'd be better, I think the previous method of guessing_UTSNAME_LENGTH
, was nice, but maybe a bit hacky :p )Make
CpuArch._internal()
use dart:ffi Abi for architecture detection, too now, instead of querying uname.You could also remove the whole
cpu_architecture.dart
file since people should really be usingdart:ffi
'sAbi
class :) But that'd be a breaking change of course.