source: rtems/doc/new_chapters/clock.t @ d7fcc1d

4.104.114.84.95
Last change on this file since d7fcc1d was d7fcc1d, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/98 at 00:05:40

Added sentence to indicate sections were deliberately empty.

Added NONE to Notes sections and "-" to make this easier to fill out later.

  • Property mode set to 100644
File size: 4.0 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Clock Manager
10
11@section Introduction
12
13The clock manager ...
14
15The directives provided by the clock manager are:
16
17@itemize @bullet
18@item @code{clock_gettime} -
19@item @code{clock_settime} -
20@item @code{clock_getres} -
21@item @code{sleep} - Delay Process Execution
22@item @code{nanosleep} -
23@item @code{gettimeofday} -
24@item @code{time} -
25@end itemize
26
27@section Background
28
29There is currently no text in this section.
30
31@section Operations
32
33There is currently no text in this section.
34
35@section Directives
36
37This section details the clock manager's directives.
38A subsection is dedicated to each of this manager's directives
39and describes the calling sequence, related constants, usage,
40and status codes.
41
42@subsection clock_gettime -
43
44@subheading CALLING SEQUENCE:
45
46@example
47#include <time.h>
48
49int clock_gettime(
50  clockid_t        clock_id,
51  struct timespec *tp
52);
53@end example
54
55@subheading STATUS CODES:
56
57On error, this routine returns -1 and sets errno to one of the following:
58
59@table @b
60@item EINVAL
61The tp pointer parameter is invalid.
62
63@item EINVAL
64The clock_id specified is invalid.
65@end table
66
67@subheading DESCRIPTION:
68
69@subheading NOTES:
70
71NONE
72
73@page
74@subsection clock_settime -
75 
76@subheading CALLING SEQUENCE:
77 
78@example
79#include <time.h>
80 
81int clock_settime(
82  clockid_t              clock_id,
83  const struct timespec *tp
84);
85@end example
86 
87@subheading STATUS CODES:
88 
89On error, this routine returns -1 and sets errno to one of the following:
90
91@table @b
92@item EINVAL
93The tp pointer parameter is invalid.
94
95@item EINVAL
96The clock_id specified is invalid.
97
98@item EINVAL
99The contents of the tp structure are invalid.
100
101@end table
102 
103@subheading DESCRIPTION:
104 
105@subheading NOTES:
106
107NONE
108 
109@page
110@subsection clock_getres -
111 
112@subheading CALLING SEQUENCE:
113 
114@example
115#include <time.h>
116 
117int clock_getres(
118  clockid_t        clock_id,
119  struct timespec *res
120);
121@end example
122 
123@subheading STATUS CODES:
124 
125On error, this routine returns -1 and sets errno to one of the following:
126
127@table @b
128@item EINVAL
129The res pointer parameter is invalid.
130
131@item EINVAL
132The clock_id specified is invalid.
133
134@end table
135 
136@subheading DESCRIPTION:
137 
138@subheading NOTES:
139 
140If res is NULL, then the resolution is not returned.
141
142@page
143@subsection sleep - Delay Process Execution
144 
145@subheading CALLING SEQUENCE:
146 
147@example
148#include <time.h>
149 
150unsigned int sleep(
151  unsigned int seconds
152);
153@end example
154 
155@subheading STATUS CODES:
156
157This routine returns the number of unslept seconds.
158
159@subheading DESCRIPTION:
160 
161The @code{sleep()} function delays the calling thread by the specified
162number of @code{seconds}.
163
164@subheading NOTES:
165
166This call is interruptible by a signal.
167 
168@page
169@subsection nanosleep -
170 
171@subheading CALLING SEQUENCE:
172 
173@example
174#include <time.h>
175 
176int nanosleep(
177  const struct timespec *rqtp,
178  struct timespec       *rmtp
179);
180@end example
181 
182@subheading STATUS CODES:
183
184On error, this routine returns -1 and sets errno to one of the following:
185
186@table @b
187@item EINTR
188The routine was interrupted by a signal.
189
190@item EAGAIN
191The requested sleep period specified negative seconds or nanoseconds.
192
193@item EINVAL
194The requested sleep period specified an invalid number for the nanoseconds
195field.
196
197@end table
198 
199@subheading DESCRIPTION:
200 
201@subheading NOTES:
202 
203This call is interruptible by a signal.
204
205@page
206@subsection gettimeofday -
207
208@subheading CALLING SEQUENCE:
209
210@example
211#include <sys/time.h>
212#include <unistd.h>
213
214int gettimeofday(
215  struct timeval  *tp,
216  struct timezone *tzp
217);
218@end example
219
220@subheading STATUS CODES:
221
222On error, this routine returns -1 and sets errno as appropriate.
223
224@subheading DESCRIPTION:
225
226@subheading NOTES:
227
228Currently, the timezone information is not supported.
229
230@page
231@subsection time -
232 
233@subheading CALLING SEQUENCE:
234 
235@example
236#include <time.h>
237 
238int time(
239  time_t  *tloc
240);
241@end example
242 
243@subheading STATUS CODES:
244
245This routine returns the number of seconds since the Epoch.
246
247@subheading DESCRIPTION:
248 
249@subheading NOTES:
250
251NONE
252 
Note: See TracBrowser for help on using the repository browser.