I have a function that gets the OS version and prints it for support reasons. And I would’ve thought that there was an API to get that somewhere. And indeed I found get_system_info in OS.h that returns a “kernel_version”. But that’s hard coded to “1”. Should it not be set to B_HAIKU_VERSION? (Really B_HAIKU_VERSION_1_BETA_4…)
Is the only way to run the uname process and parse the output?
Edit: I’ve found ‘__get_haiku_revision’ which gives me the hrev… still need the “which beta”…
That’s one option, or you can use get_image_info, find libbe.so or libroot.so there, and check it’s “abi” and “api_version” fields. First check that abi is “B_HAIKU_ABI” (in case you’re not running on Haiku?) and then check api_version against the list defined in BeBuild.h:
Yes, R1 beta 4 is not the same as R1.4. And, maybe more immediately problematic, it is also very different from R1 alpha 4 which also exists. This is also why uname just says 1. These are all just development builds of Haiku version 1.
If you look at the B_HAIKU_VERSION_* constants and how their values are constructed, you can see that it is internally represented as “0.8.0”. Although I wouldn’t use that as an user facing version either, because no one will understand what it means.