vermagic.c 459 B

123456789101112131415161718192021222324
  1. /*
  2. insmod /vermagic.ko
  3. # => 4.9.6 SMP mod_unload modversions
  4. TODO how to get the vermagic from running kernel from userland?
  5. <https://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-October/006306.html>
  6. */
  7. #include <linux/module.h>
  8. #include <linux/kernel.h>
  9. #include <linux/vermagic.h>
  10. static int myinit(void)
  11. {
  12. pr_info(__FILE__ "\n");
  13. return 0;
  14. }
  15. static void myexit(void) {}
  16. module_init(myinit)
  17. module_exit(myexit)
  18. MODULE_LICENSE("GPL");