title: <random> generates same number in Linux, but not in Windows
body: <p>The code below is meant to generate a list of five pseudo-random numbers in the interval [1,100]. I seed the <code>default_random_engine</code> with <code>time(0)</code>, which returns the system time in <a href="https://en.wikipedia.org/wiki/Unix_time" rel="noreferrer">unix time</a>. When I compile and run this program on Windows 7 using Microsoft Visual Studio 2013, it works as expected (see below). When I do so in Arch Linux with the g++ compiler, however, it behaves strangely.</p>
  
  <p>In Linux, 5 numbers will be generated each time. The last 4 numbers will be different on each execution (as will often be the case), but the first number will stay the same.</p>
  
  <p>Example output from 5 executions on Windows and Linux:</p>
  
  <pre><code>      | Windows:       | Linux:        
  ---------------------------------------
  Run 1 | 54,01,91,73,68 | 25,38,40,42,21
  Run 2 | 46,24,16,93,82 | 25,78,66,80,81
  Run 3 | 86,36,33,63,05 | 25,17,93,17,40
  Run 4 | 75,79,66,23,84 | 25,70,95,01,54
  Run 5 | 64,36,32,44,85 | 25,09,22,38,13
  </code></pre>
  
  <p>Adding to the mystery, that first number periodically increments by one on Linux. After obtaining the above outputs, I waited about 30 minutes and tried again to find that the 1st number had changed and now was always being generated as a 26. It has continued to increment by 1 periodically and is now at 32. It seems to correspond with the changing value of <code>time(0)</code>.</p>
  
  <p><strong>Why does the first number rarely change across runs, and then when it does, increment by 1?</strong></p>
  
  <p>The code. It neatly prints out the 5 numbers and the system time:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;random&gt;
  #include &lt;time.h&gt;
  
  using namespace std;
  
  int main()
  {
      const int upper_bound = 100;
      const int lower_bound = 1;
  
      time_t system_time = time(0);    
  
      default_random_engine e(system_time);
      uniform_int_distribution&lt;int&gt; u(lower_bound, upper_bound);
  
      cout &lt;&lt; '#' &lt;&lt; '\t' &lt;&lt; "system time" &lt;&lt; endl
           &lt;&lt; "-------------------" &lt;&lt; endl;
  
      for (int counter = 1; counter &lt;= 5; counter++)
      {
          int secret = u(e);
          cout &lt;&lt; secret &lt;&lt; '\t' &lt;&lt; system_time &lt;&lt; endl;
      }   
  
      system("pause");
      return 0;
  }
  </code></pre>