title: Check Kernel version at runtime in C
body: <p>I have seen posts like <a href="https://stackoverflow.com/questions/2987592/read-linux-kernel-version-using-c">this</a> on StackOverflow which talk about using <code>uname()</code> to get the current Kernel version number (stored in <a href="https://linux.die.net/man/2/uname" rel="nofollow noreferrer">utsname.release</a>). However that returns a string.</p>
  
  <p>Is there a way to return the or check the Kernel version as a numerical value so that one can simply use <code>if (version &gt;= min_req_ver) { ... }</code> ?</p>
  
  <p>The only method I have seen is to include <code>linux/version.h</code> and check <code>LINUX_VERSION_CODE</code> however in CentOS for example, this version number is not updated when one runs a newer Kernel than the default. The <code>uname()</code> function however does report the correct current Kernel version across Linux distros (on the ones I have tested) including in scenario such as using CentOS with a newer Kernel.</p>