hello-2.c 555 B

1234567891011121314151617181920212223
  1. /*
  2. * hello-2.c - Demonstrating the module_init() and module_exit() macros.
  3. * This is preferred over using init_module() and cleanup_module().
  4. */
  5. #include <linux/init.h> /* Needed for the macros */
  6. #include <linux/kernel.h> /* Needed for KERN_INFO */
  7. #include <linux/module.h> /* Needed by all modules */
  8. static int __init hello_2_init(void)
  9. {
  10. pr_info("Hello, world 2\n");
  11. return 0;
  12. }
  13. static void __exit hello_2_exit(void)
  14. {
  15. pr_info("Goodbye, world 2\n");
  16. }
  17. module_init(hello_2_init);
  18. module_exit(hello_2_exit);
  19. MODULE_LICENSE("GPL");