source: rtems/doc/posix_users/clock.t @ 8ea8326

4.104.114.84.95
Last change on this file since 8ea8326 was 6449498, checked in by Joel Sherrill <joel.sherrill@…>, on 01/17/02 at 21:47:47

2001-01-17 Joel Sherrill <joel@…>

  • SUPPORT, LICENSE: New files.
  • Numerous files touched as part of merging the 4.5 branch onto the mainline development trunk and ensuring that the script that cuts snapshots and releases works on the documentation.
  • Property mode set to 100644
File size: 5.1 KB
Line 
1@c
2@c COPYRIGHT (c) 1988-2002.
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} - Obtain Time of Day
19@item @code{clock_settime} - Set Time of Day
20@item @code{clock_getres} - Get Clock Resolution
21@item @code{sleep} - Delay Process Execution
22@item @code{nanosleep} - Delay with High Resolution
23@item @code{gettimeofday} - Get the Time of Day
24@item @code{time} - Get time in seconds
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 -Obtain Time of Day
43
44@findex clock_gettime
45@cindex obtain time of day
46
47@subheading CALLING SEQUENCE:
48
49@example
50#include <time.h>
51
52int clock_gettime(
53  clockid_t        clock_id,
54  struct timespec *tp
55);
56@end example
57
58@subheading STATUS CODES:
59
60On error, this routine returns -1 and sets errno to one of the following:
61
62@table @b
63@item EINVAL
64The tp pointer parameter is invalid.
65
66@item EINVAL
67The clock_id specified is invalid.
68@end table
69
70@subheading DESCRIPTION:
71
72@subheading NOTES:
73
74NONE
75
76@c
77@c
78@c
79@page
80@subsection clock_settime - Set Time of Day
81
82@findex clock_settime
83@cindex  set time of day
84
85@subheading CALLING SEQUENCE:
86
87@example
88#include <time.h>
89
90int clock_settime(
91  clockid_t              clock_id,
92  const struct timespec *tp
93);
94@end example
95
96@subheading STATUS CODES:
97
98On error, this routine returns -1 and sets errno to one of the following:
99
100@table @b
101@item EINVAL
102The tp pointer parameter is invalid.
103
104@item EINVAL
105The clock_id specified is invalid.
106
107@item EINVAL
108The contents of the tp structure are invalid.
109
110@end table
111
112@subheading DESCRIPTION:
113
114@subheading NOTES:
115
116NONE
117
118@c
119@c
120@c
121@page
122@subsection clock_getres - Get Clock Resolution
123
124@findex clock_getres
125@cindex  get clock resolution
126
127@subheading CALLING SEQUENCE:
128
129@example
130#include <time.h>
131
132int clock_getres(
133  clockid_t        clock_id,
134  struct timespec *res
135);
136@end example
137
138@subheading STATUS CODES:
139
140On error, this routine returns -1 and sets errno to one of the following:
141
142@table @b
143@item EINVAL
144The res pointer parameter is invalid.
145
146@item EINVAL
147The clock_id specified is invalid.
148
149@end table
150
151@subheading DESCRIPTION:
152
153@subheading NOTES:
154
155If res is NULL, then the resolution is not returned.
156
157@c
158@c
159@c
160@page
161@subsection sleep - Delay Process Execution
162
163@findex sleep
164@cindex  delay process execution
165
166@subheading CALLING SEQUENCE:
167
168@example
169#include <time.h>
170
171unsigned int sleep(
172  unsigned int seconds
173);
174@end example
175
176@subheading STATUS CODES:
177
178This routine returns the number of unslept seconds.
179
180@subheading DESCRIPTION:
181
182The @code{sleep()} function delays the calling thread by the specified
183number of @code{seconds}.
184
185@subheading NOTES:
186
187This call is interruptible by a signal.
188
189@c
190@c
191@c
192@page
193@subsection nanosleep - Delay with High Resolution
194
195@findex nanosleep
196@cindex  delay with high resolution
197
198@subheading CALLING SEQUENCE:
199
200@example
201#include <time.h>
202
203int nanosleep(
204  const struct timespec *rqtp,
205  struct timespec       *rmtp
206);
207@end example
208
209@subheading STATUS CODES:
210
211On error, this routine returns -1 and sets errno to one of the following:
212
213@table @b
214@item EINTR
215The routine was interrupted by a signal.
216
217@item EAGAIN
218The requested sleep period specified negative seconds or nanoseconds.
219
220@item EINVAL
221The requested sleep period specified an invalid number for the nanoseconds
222field.
223
224@end table
225
226@subheading DESCRIPTION:
227
228@subheading NOTES:
229
230This call is interruptible by a signal.
231
232@c
233@c
234@c
235@page
236@subsection gettimeofday - Get the Time of Day
237
238@findex gettimeofday
239@cindex  get the time of day
240
241@subheading CALLING SEQUENCE:
242
243@example
244#include <sys/time.h>
245#include <unistd.h>
246
247int gettimeofday(
248  struct timeval  *tp,
249  struct timezone *tzp
250);
251@end example
252
253@subheading STATUS CODES:
254
255On error, this routine returns -1 and sets @code{errno} as appropriate.
256
257@table @b
258@item EPERM
259@code{settimeofdat} is called by someone other than the superuser.
260
261@item EINVAL
262Timezone (or something else) is invalid.
263
264@item EFAULT
265One of @code{tv} or @code{tz} pointed outside your accessible address
266space
267
268@end table
269
270@subheading DESCRIPTION:
271
272This routine returns the current time of day in the @code{tp} structure.
273
274@subheading NOTES:
275
276Currently, the timezone information is not supported. The @code{tzp}
277argument is ignored.
278
279@c
280@c
281@c
282@page
283@subsection time - Get time in seconds
284
285@findex time
286@cindex  get time in seconds
287
288@subheading CALLING SEQUENCE:
289
290@example
291#include <time.h>
292
293int time(
294  time_t *tloc
295);
296@end example
297
298@subheading STATUS CODES:
299
300This routine returns the number of seconds since the Epoch.
301
302@subheading DESCRIPTION:
303
304@code{time} returns the time since 00:00:00 GMT, January 1, 1970,
305measured in seconds
306
307If @code{tloc} in non null, the return value is also stored in the
308memory pointed to by @code{t}.
309
310@subheading NOTES:
311
312NONE
313
Note: See TracBrowser for help on using the repository browser.