170 lines
6.1 KiB
HTML
170 lines
6.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title><sys/time.h></title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../../jscript/dotcode.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="<sys/time.h>"></a> <a name="tag_13_64"></a><!-- <sys/time.h> -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_13_64_01"></a>NAME</h4>
|
|
|
|
<blockquote>sys/time.h - time types</blockquote>
|
|
|
|
<h4><a name="tag_13_64_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <sys/time.h> <img src="../../images/opt-end.gif" alt="[Option End]" border=
|
|
"0"></tt></div>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_64_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i><sys/time.h></i> header shall define the <b>timeval</b> structure that includes at least the following members:</p>
|
|
|
|
<pre>
|
|
<tt>time_t tv_sec </tt> Seconds. <tt>
|
|
suseconds_t tv_usec </tt> Microseconds. <tt>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The <i><sys/time.h></i> header shall define the <b>itimerval</b> structure that includes at least the following
|
|
members:</p>
|
|
|
|
<pre>
|
|
<tt>struct timeval it_interval</tt> Timer interval. <tt>
|
|
struct timeval it_value </tt> Current value. <tt>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The <b>time_t</b> and <b>suseconds_t</b> types shall be defined as described in <a href=
|
|
"../sys/types.h.html#tag_13_67"><i><sys/types.h></i></a> .</p>
|
|
|
|
<p>The <b>fd_set</b> type shall be defined as described in <a href="../sys/select.h.html#tag_13_58"><i><sys/select.h></i></a>
|
|
.</p>
|
|
|
|
<p>The <i><sys/time.h></i> header shall define the following values for the <i>which</i> argument of <a href=
|
|
"../../functions/getitimer.html"><i>getitimer</i>()</a> and <a href="../../functions/setitimer.html"><i>setitimer</i>()</a>:</p>
|
|
|
|
<dl compact>
|
|
<dt>ITIMER_REAL</dt>
|
|
|
|
<dd>Decrements in real time.</dd>
|
|
|
|
<dt>ITIMER_VIRTUAL</dt>
|
|
|
|
<dd>Decrements in process virtual time.</dd>
|
|
|
|
<dt>ITIMER_PROF</dt>
|
|
|
|
<dd>Decrements both in process virtual time and when the system is running on behalf of the process.</dd>
|
|
</dl>
|
|
|
|
<p>The following shall be defined as described in <a href="../sys/select.h.html#tag_13_58"><i><sys/select.h></i></a> : <a
|
|
href="../../functions/FD_CLR.html"><i>FD_CLR</i>()</a> <a href="../../functions/FD_ISSET.html"><i>FD_ISSET</i>()</a> <a href=
|
|
"../../functions/FD_SET.html"><i>FD_SET</i>()</a> <a href="../../functions/FD_ZERO.html"><i>FD_ZERO</i>()</a> FD_SETSIZE</p>
|
|
|
|
<p>The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.</p>
|
|
|
|
<pre>
|
|
<tt>int getitimer(int, struct itimerval *);
|
|
int gettimeofday(struct timeval *restrict, void *restrict);
|
|
int select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
|
|
struct timeval *restrict);
|
|
int setitimer(int, const struct itimerval *restrict,
|
|
struct itimerval *restrict);
|
|
int utimes(const char *, const struct timeval [2]); (</tt><b>LEGACY</b> <tt>)
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>Inclusion of the <i><sys/time.h></i> header may make visible all symbols from the <a href=
|
|
"../../basedefs/sys/select.h.html"><i><sys/select.h></i></a> header.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_13_64_04"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_64_05"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_64_06"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_64_07"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="../sys/select.h.html#tag_13_58"><i><sys/select.h></i></a> , <a href=
|
|
"../sys/types.h.html#tag_13_67"><i><sys/types.h></i></a> , the System Interfaces volume of IEEE Std 1003.1-2001, <a
|
|
href="../../functions/getitimer.html"><i>getitimer</i>()</a>, <a href=
|
|
"../../functions/gettimeofday.html"><i>gettimeofday</i>()</a>, <a href="../../functions/select.html"><i>select</i>()</a>, <a href=
|
|
"../../functions/setitimer.html"><i>setitimer</i>()</a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_64_08"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 4, Version 2.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_64_09"></a>Issue 5</h4>
|
|
|
|
<blockquote>
|
|
<p>The type of <i>tv_usec</i> is changed from <b>long</b> to <b>suseconds_t</b>.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_64_10"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>The <b>restrict</b> keyword is added to the prototypes for <a href=
|
|
"../../functions/gettimeofday.html"><i>gettimeofday</i>()</a>, <a href="../../functions/select.html"><i>select</i>()</a>, and <a
|
|
href="../../functions/setitimer.html"><i>setitimer</i>()</a>.</p>
|
|
|
|
<p>The note is added that inclusion of this header may also make symbols visible from <a href=
|
|
"../../basedefs/sys/select.h.html"><i><sys/select.h></i></a>.</p>
|
|
|
|
<p>The <a href="../../functions/utimes.html"><i>utimes</i>()</a> function is marked LEGACY.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../../mindex.html">Main Index</a> | <a href="../../basedefs/contents.html">XBD</a> | <a href=
|
|
"../../utilities/contents.html">XCU</a> | <a href="../../functions/contents.html">XSH</a> | <a href=
|
|
"../../xrat/contents.html">XRAT</a> ]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|