title: error: ‘struct task_struct’ has no member named ‘it_virt_value’
body: <p>I am trying to create a system call in Linux ubuntu-studio that has the following functionality:</p>
  
  <p>bring virtual memory the larger process and how much bytes it occupies.</p>
  
  <p>below is the implementation code of the system call:</p>
  
  <pre><code>#include &lt;linux/module.h&gt;
  #include &lt;linux/printk.h&gt;
  #include &lt;linux/sched.h&gt;
  
  struct pid_size{
      int pid;
      unsigned long size;
  };
  
  
  struct pid_size pid maiorMemoriaVirtual(void)
  {
      struct task_struct *task;
      struct task_struct *maior = NULL;
  
      for_each_process(task)
      {
          if(maior == NULL)
              maior = task; 
          else if(task-&gt;it_virt_value &gt; maior-&gt;it_virt_value)
              maior = task;
      }
  
      struct pid_size retorno;
      retorno.pid = maior-&gt;pid;
      retorno.size = maior-&gt;it_virt_value;
  
      return retorno;
  }
  </code></pre>
  
  <p>When compiling to try compiling the kernel got the following error:</p>
  
  <pre><code>kernel/maiorMemoriaVirtual.c: In function ‘sys_maiorMemoriaVirtual’:
  kernel/maiorMemoriaVirtual.c:19:21: error: ‘struct task_struct’ has no member named ‘it_virt_value’
           else if(task-&gt;it_virt_value &gt; maior-&gt;it_virt_value)
                       ^
  kernel/maiorMemoriaVirtual.c:19:44: error: ‘struct task_struct’ has no member named ‘it_virt_value’
           else if(task-&gt;it_virt_value &gt; maior-&gt;it_virt_value)
                                              ^
  kernel/maiorMemoriaVirtual.c:23:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
       struct pid_size retorno;
       ^
  kernel/maiorMemoriaVirtual.c:25:25: error: ‘struct task_struct’ has no member named ‘it_virt_value’
       retorno.size = maior-&gt;it_virt_value;
                           ^
  make[1]: ** [kernel/maiorMemoriaVirtual.o] Erro 1
  </code></pre>