Add gettimeofday()

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1974 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-07-11 23:39:33 +00:00
parent 631788ece1
commit 4f255b5fdf
6 changed files with 220 additions and 1 deletions
+28
View File
@@ -2469,6 +2469,7 @@ VxWorks provides the following comparable interface:
<li><a href="#timersettime">2.7.9 timer_settime</a></li>
<li><a href="#timergettime">2.7.10 timer_gettime</a></li>
<li><a href="#timergetoverrun">2.7.11 timer_getoverrun</a></li>
<li><a href="#gettimeofday">2.7.12 gettimeofday</a></li>
</ul>
<H3><a name="clocksettime">2.7.1 clock_settime</a></H3>
@@ -2917,6 +2918,33 @@ VxWorks provides the following comparable interface:
interface of the same name.
</p>
<h3><a name="gettimeofday">2.7.12 gettimeofday</a></h3>
<p>
<b>Function Prototype:</b>
</p>
<pre>
#include &lt;sys/time.h&gt;
int gettimeofday(struct timeval *tp, void *tzp);
</pre>
<p>
<b>Description:</b>
This implementation of <code>gettimeofday()</code> is simply a thin wrapper around
<a href="#clockgettime"><code>clock_gettime()</code></a>.
It simply calls <code>clock_gettime()</code> using the <code>CLOCK_REALTIME</code> timer and
converts the result to the required <code>struct timeval</code>.
</p>
<p>
<b>Input Parameters:</b>
</p>
<ul>
<li><code>tp</code>. The current time will be returned to this user provided location.</li>
<li><code>tzp</code>. A reference to the timezone -- <i>IGNORED</i>.</li>
</ul>
<p>
<b>Returned Values:</b>
See <a href="#clockgettime"><code>clock_gettime()</code></a>.
</p>
<table width ="100%">
<tr bgcolor="#e4e4e4">
<td>