Getting kernel version from linux kernel module at runtime

后端 未结 3 2066
后悔当初
后悔当初 2020-12-06 20:03

how can I obtain runtime information about which version of kernel is running from inside linux kernel module code (kernel mode)?

3条回答
  •  一个人的身影
    2020-12-06 20:22

    You can only safely build a module for any one kernel version at a time. This means that asking from a module at runtime is redundant.

    You can find this out at build time, by looking at the value of UTS_RELEASE in recent kernels this is in amongst other ways of doing this.

提交回复
热议问题