title: printing number of processes in kernel module
body: <p>I'm very new to kernel programming and I have written a small kernel module which is like this,</p>
  
  <p>mod.c</p>
  
  <pre><code>#include&lt;linux/kernel.h&gt;
  #include&lt;linux/module.h&gt;
  #include&lt;sys/sysinfo.h&gt;
  
  int init_module(void)
  {
      int k;
      struct sysinfo info;
      printk(KERN_INFO "hello\n");
      k = sysinfo(&amp;info);
      printk(KERN_EMERG "procs = %d\n", info.procs)
  
      return 0;
  }
  
  void cleanup_module(void)
  {
  
      printk(KERN_INFO "Goodbye\n");
  }
  </code></pre>
  
  <p>and Makefile looks like this,</p>
  
  <pre><code> obj-m +=mod.o
  
   all:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
  
   clean:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
  </code></pre>
  
  <p>if i issue make from terminal, it gives error<br/>
          fatal error: sys/sysinfo.h: No such file or directory<br/></p>
  
  <p>could you tell me what's the problem here?<br/></p>