title: reading linux inode bitmap
body: <p>I'm going to fetch linux inode bitmaps with c++. I've use this code to fetch super block first:  </p>
  
  <pre><code>    #include &lt;cstdlib&gt;
      #include &lt;linux/ext2_fs.h&gt;
      #include &lt;linux/fs.h&gt;
      #include &lt;iostream&gt;
      #include &lt;stdio.h&gt;
      #include &lt;fstream&gt;
      #include &lt;fcntl.h&gt;
      #include &lt;linux/fs.h&gt;
  
      using namespace std;
  
      /*
       * 
       */
  
      int main() {
          int fd;
          char boot[1024];
          struct ext2_super_block super_block;
  
          fd = open("/dev/sda1", O_RDONLY);
      /* Reads the boot section and the superblock */
      read(fd, boot, 1024);
      read(fd, &amp;super_block, sizeof (struct ext2_super_block));
  
      /* Prints the Magic Number */
      printf("%x\n", super_block.s_magic);
  
      close(fd);
  
      return 0;
  }
  </code></pre>
  
  <p>but every time i run it , i get a error : </p>
  
  <pre><code>In file included from main.cpp:2:0:
  /usr/include/linux/ext2_fs.h:181:18: error: ‘S_ISDIR’ was not declared in this scope
  /usr/include/linux/ext2_fs.h:183:23: error: ‘S_ISREG’ was not declared in this scope
  </code></pre>
  
  <p>I couldn't find any good example or tutorial for this.is there anybody to help me?</p>
  
  <p>EDIT :<br>
  I've include <code>&lt;linux/stat.h&gt;</code> but still get same error.</p>