title: Cannot access ifreq structure definition, __USE_MISC macro undefined
body: <p>I am trying to compile the following single C file (called main.c):</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define __USE_MISC 1
  #include &lt;net/if.h&gt;
  
  int main(int argc, char **argv)
  {
  ifreq id_ifreq;
  fprintf(stdout, "&gt;&gt;&gt;&gt;&gt;&gt; OK &lt;&lt;&lt;&lt;&lt;&lt;\n");
  }
  </code></pre>
  
  <p>... using "gcc main.c -o main". I get the following error:</p>
  
  <pre><code>main.c: In function ‘main’:
  main.c:9:2: error: unknown type name ‘ifreq’
  </code></pre>
  
  <p>I know that "ifreq" structure definition lies within a "#ifdef __USE_MISC" macro, however, I cannot activate that block of code.</p>
  
  <p>I developed the following code for checking which MACROS are defined (compiled with "gcc main.c -o main"):</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;net/if.h&gt;
  
  int main(int argc, char **argv)
  {
  
     #ifdef __USE_MISC
         printf("__USE_MISC defined\n");
     #endif
     #ifdef _GNU_SOURCE
         printf("_GNU_SOURCE defined\n");
     #endif
  
     #ifdef _BSD_SOURCE
         printf("_BSD_SOURCE defined\n");
     #endif
  
     #ifdef _SVID_SOURCE
         printf("_SVID_SOURCE defined\n");
     #endif
  
  }
  </code></pre>
  
  <p>The result is that they are all defined but the "_GNU_SOURCE" one. However, I am still not capable of using the definition of the "ifreq" structure included in the "net/if.h" file.</p>
  
  <p>Anybody can help?</p>