title: copy timeval member variables to integer variable
body: <p>I need represent <code>timeval</code> structure using two <code>integer</code> parameters p1 and p2.
  I have copied <code>tv_sec</code> to p1 and <code>tv_usec</code> to p2.
  In 32 bit (centos) <code>sizeof(long) = sizeof(int)</code> hence I was able to do above said thing.</p>
  
  <p>But in 64 bit system, (sizeof(tv_sec) = 8).</p>
  
  <p>In 64 bit system how can I assign this <code>tv_sec</code> to p1 and p2 as that of 32 bit sytem ? </p>
  
  <p>My code is given below,</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sys/time.h&gt;
  using namespace std;
  
  int main()
  {
    struct timeval mytime;
  
    gettimeofday(&amp;mytime, NULL);
  
    cout &lt;&lt; "tv_sec_1 :  " &lt;&lt; mytime.tv_sec &lt;&lt; endl;
    cout &lt;&lt; "tv_usec_1 : " &lt;&lt; mytime.tv_usec &lt;&lt; endl;
  
    int p1 = mytime.tv_sec;
    int p2 = mytime.tv_usec;
  
  }
  </code></pre>
  
  <p>I need pass these timeval info using two free integer variables in the structure
  through which output is passed to calling function. My aim is not to modify result structure.</p>