title: State from task_struct not defined
body: <p>My question is simple. I'm reading from task_struct struct to be able to access a process state. I'm coding a custom kernel module in C to read the properties of the current processess in my machine. The state attribute is defined as a long unsigned number, and according to sched.h, that number can be interpreted as:</p>
  <pre><code>/* Used in tsk-&gt;state: */
  #define TASK_RUNNING            0x0000
  #define TASK_INTERRUPTIBLE      0x0001
  #define TASK_UNINTERRUPTIBLE    0x0002
  #define __TASK_STOPPED          0x0004
  #define __TASK_TRACED           0x0008
  /* Used in tsk-&gt;exit_state: */
  #define EXIT_DEAD               0x0010
  #define EXIT_ZOMBIE             0x0020
  #define EXIT_TRACE              (EXIT_ZOMBIE | EXIT_DEAD)
  /* Used in tsk-&gt;state again: */
  #define TASK_PARKED             0x0040
  #define TASK_DEAD               0x0080
  #define TASK_WAKEKILL           0x0100
  #define TASK_WAKING             0x0200
  #define TASK_NOLOAD             0x0400
  #define TASK_NEW                0x0800
  #define TASK_STATE_MAX          0x1000
  </code></pre>
  <p>The thing is, I'm getting a 0x0402(1026 as decimal) value as state in the task. What does that mean? How it can it be interpretated?</p>