title: How to run this threads example?
body: <p>I'm trying the code from Tanenbaum's 3e "Modern Operating Systems" and I get compiler errors and warnings:</p>
  
  <pre><code>$ LANG=en_US.UTF-8 cc thread.c 
  thread.c: In function ‘main’:
  thread.c:19:63: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  thread.c:25:1: warning: passing argument 1 of ‘exit’ makes integer from pointer without a cast [enabled by default]
  /usr/include/stdlib.h:544:13: note: expected ‘int’ but argument is of type ‘void *’
  /tmp/ccqxmMgE.o: In function `main':
  thread.c:(.text+0x57): undefined reference to `pthread_create'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>This is the code I'm trying</p>
  
  <pre><code>#include &lt;pthread.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  #define NUMBER_OF_THREADS   10
  
  void *print_hello_world(void *tid)
  {
    //printf("Hello World. Greetings from thread %d0", tid);
    pthread_exit(NULL);
  }
  int main(int argc, char *argv[])
  {
    pthread_t threads[NUMBER_OF_THREADS];
    int status, i;
  
    for(i=0; i&lt;NUMBER_OF_THREADS; i++) {
    //printf("Main here creating thread %d0", i);
    status = pthread_create(&amp;threads[i], NULL, print_hello_world, (void *)i);
  
    if (status != 0) {
      //printf("Oops. pthread_create returned error code %d0", status);
      exit(-1);
    }
  }
  exit(NULL);
  }
  </code></pre>
  
  <p>Can you help me improve the state of the code so that it will run? There appears to be some errata since the exact code from the book doesn't compile. Thanks</p>