Skip to content

Instantly share code, notes, and snippets.

@md-jamal
Created May 5, 2019 03:53
Show Gist options
  • Save md-jamal/cf20f8eaf7da0abd248bc9a6be837bcb to your computer and use it in GitHub Desktop.
Save md-jamal/cf20f8eaf7da0abd248bc9a6be837bcb to your computer and use it in GitHub Desktop.
#include <linux/module.h> /* for MODULE_*. module_* */
#include <linux/printk.h> /* for pr_* */
#include <linux/cpumask.h> /* for num_online_cpus */
static int __init mod_init(void)
{
pr_info("number of online cpus is %d\n", num_online_cpus());
return 0;
}
static void __exit mod_exit(void)
{
}
module_init(mod_init);
module_exit(mod_exit);
MODULE_LICENSE("GPL");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment