Querying Linux OS version info
Is there a function similar to the Windows function GetVersionEx() to query general OS info like distributor, build number, etc.?
Most people would probably use ''uname -a''. The returned string should properly report all the goodies you want.
For the C/C++ header and functions, take a look at ''man 3 uname''.
Int.
For the C/C++ header and functions, take a look at ''man 3 uname''.
Int.
distro version varies. search for a file called *-version or *-release in /etc that should have version information it it.
build number doesn''t exist. version of rpms installed can be found somehow. debs too. never looked into this. I''d probably just use the ''rpm'' and ''dpkg'' directly to find out.
uname will find KERNEL information.
In general, the answer to a question like this is to say, You''re thinking like a windows programmer. You don''t need to know any of that. Unless you do, maybe you should tell us what you''re trying to do, so we can tell you if you need to know.
build number doesn''t exist. version of rpms installed can be found somehow. debs too. never looked into this. I''d probably just use the ''rpm'' and ''dpkg'' directly to find out.
uname will find KERNEL information.
In general, the answer to a question like this is to say, You''re thinking like a windows programmer. You don''t need to know any of that. Unless you do, maybe you should tell us what you''re trying to do, so we can tell you if you need to know.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement