title: the pipes don"t send the tab
body: <p>In my code, i have to use several pipes, the father must send each sons an interval, and in this interval the son must search prime numbers.</p>
  
  <p>the problem is that the interval sent by the father is not received by the sons.
  this is my code :</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;math.h&gt;
  
  int main(void)
  {
      const int p = 4;
      const int n = 500;
  
      int k, i, j;
      int premier;
  
      pid_t fils[p];
      int tubePere[2], tubeFils[p][2], intervals1[2], intervals2[2];
  
      pipe(tubePere);
      for (k = 0; k &lt; p; k++)
      {
          pipe(tubeFils[p]);
          fils[k] = fork();
          intervals1[0] = k * n/p + 1;
          intervals1[1] = (k + 1) * n/p;
          printf("intervals1 : %d .. %d\n",intervals1[0], intervals1[1]);
          close(tubeFils[k][0]);
          write(tubeFils[k][1], intervals1, sizeof(intervals1));
          if (fils[k] == 0)
          {
              close(tubeFils[k][1]);
              read(tubeFils[k][0],  intervals2, sizeof(intervals2));
              printf("intervals2 : %d .. %d\n",intervals2[0], intervals2[1]);
              for (i = intervals1[0]; i &lt;= intervals2[1]; i++)
              {
                  if (i == 1)
                      premier = 0;
                  else if (i == 2)
                      premier = 1;
                  else
                  {
                      j = 2;
                      premier = 1;
                      while ((j &lt;= sqrt(i)) &amp;&amp; (premier == 1))
                      {
                          if ((i%j) == 0)
                              premier = 0;
                          j++;
                      }
                  }
                  if (premier == 1)
                  {
                     //printf("%d  ",i);
                  }
              }
              exit(0);
  
          }
          else if (fils[k] == -1)
              printf("Error\n");
      }
      return 0;
  }
  </code></pre>
  
  <p>I displayed the intervals received by the sons and send by the father</p>
  
  <pre><code>intervals1 : 1 .. 125
  intervals1 : 126 .. 250
  intervals1 : 251 .. 375
  intervals1 : 376 .. 500
  intervals1 : 1 .. 125
  intervals1 : 126 .. 250
  intervals1 : 251 .. 375
  intervals1 : 376 .. 500
  intervals2 : 0 .. 255
  intervals1 : 1 .. 125
  intervals1 : 126 .. 250
  intervals1 : 251 .. 375
  intervals2 : 0 .. 255
  intervals1 : 1 .. 125
  intervals1 : 126 .. 250
  intervals2 : 0 .. 255
  intervals1 : 1 .. 125
  intervals2 : 0 .. 255
  </code></pre>