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

4.104.114.84.95
Last change on this file since c11f512 was c11f512, checked in by Wade A Smith <warm38@…>, on 09/30/98 at 15:45:08

Updated the DESCRIPTION section of the times routine.

  • Property mode set to 100644
File size: 5.1 KB
RevLine 
[6c914e9]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
[4ebb4862]10
[6c914e9]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} -
[d7fcc1d]21@item @code{sleep} - Delay Process Execution
[6c914e9]22@item @code{nanosleep} -
[f1ccfde]23@item @code{gettimeofday} - Get the Time of Day
24@item @code{time} - Get time in seconds
25@item @code{times} - Get process times
[6c914e9]26@end itemize
27
28@section Background
29
[d7fcc1d]30There is currently no text in this section.
31
[6c914e9]32@section Operations
33
[d7fcc1d]34There is currently no text in this section.
35
[6c914e9]36@section Directives
37
38This section details the clock manager's directives.
39A subsection is dedicated to each of this manager's directives
40and describes the calling sequence, related constants, usage,
41and status codes.
42
[d7fcc1d]43@subsection clock_gettime -
[6c914e9]44
45@subheading CALLING SEQUENCE:
46
47@example
48#include <time.h>
49
50int clock_gettime(
51  clockid_t        clock_id,
52  struct timespec *tp
53);
54@end example
55
56@subheading STATUS CODES:
57
58On error, this routine returns -1 and sets errno to one of the following:
59
60@table @b
61@item EINVAL
62The tp pointer parameter is invalid.
63
64@item EINVAL
65The clock_id specified is invalid.
66@end table
67
68@subheading DESCRIPTION:
69
70@subheading NOTES:
71
[d7fcc1d]72NONE
73
[6c914e9]74@page
[d7fcc1d]75@subsection clock_settime -
[6c914e9]76 
77@subheading CALLING SEQUENCE:
78 
79@example
80#include <time.h>
81 
82int clock_settime(
83  clockid_t              clock_id,
84  const struct timespec *tp
85);
86@end example
87 
88@subheading STATUS CODES:
89 
90On error, this routine returns -1 and sets errno to one of the following:
91
92@table @b
93@item EINVAL
94The tp pointer parameter is invalid.
95
96@item EINVAL
97The clock_id specified is invalid.
98
99@item EINVAL
100The contents of the tp structure are invalid.
101
102@end table
103 
104@subheading DESCRIPTION:
105 
106@subheading NOTES:
[d7fcc1d]107
108NONE
[6c914e9]109 
110@page
[d7fcc1d]111@subsection clock_getres -
[6c914e9]112 
113@subheading CALLING SEQUENCE:
114 
115@example
116#include <time.h>
117 
118int clock_getres(
119  clockid_t        clock_id,
120  struct timespec *res
121);
122@end example
123 
124@subheading STATUS CODES:
125 
126On error, this routine returns -1 and sets errno to one of the following:
127
128@table @b
129@item EINVAL
130The res pointer parameter is invalid.
131
132@item EINVAL
133The clock_id specified is invalid.
134
135@end table
136 
137@subheading DESCRIPTION:
138 
139@subheading NOTES:
140 
141If res is NULL, then the resolution is not returned.
142
143@page
[d7fcc1d]144@subsection sleep - Delay Process Execution
[6c914e9]145 
146@subheading CALLING SEQUENCE:
147 
148@example
149#include <time.h>
150 
151unsigned int sleep(
152  unsigned int seconds
153);
154@end example
155 
156@subheading STATUS CODES:
157
158This routine returns the number of unslept seconds.
159
160@subheading DESCRIPTION:
161 
[d7fcc1d]162The @code{sleep()} function delays the calling thread by the specified
163number of @code{seconds}.
164
[6c914e9]165@subheading NOTES:
166
167This call is interruptible by a signal.
168 
169@page
[d7fcc1d]170@subsection nanosleep -
[6c914e9]171 
172@subheading CALLING SEQUENCE:
173 
174@example
175#include <time.h>
176 
177int nanosleep(
178  const struct timespec *rqtp,
179  struct timespec       *rmtp
180);
181@end example
182 
183@subheading STATUS CODES:
184
185On error, this routine returns -1 and sets errno to one of the following:
186
187@table @b
188@item EINTR
189The routine was interrupted by a signal.
190
191@item EAGAIN
192The requested sleep period specified negative seconds or nanoseconds.
193
194@item EINVAL
195The requested sleep period specified an invalid number for the nanoseconds
196field.
197
198@end table
199 
200@subheading DESCRIPTION:
201 
202@subheading NOTES:
203 
204This call is interruptible by a signal.
205
[c247120a]206@page
[f1ccfde]207@subsection gettimeofday - Get the Time of Day
[c247120a]208
209@subheading CALLING SEQUENCE:
210
211@example
212#include <sys/time.h>
213#include <unistd.h>
214
215int gettimeofday(
216  struct timeval  *tp,
217  struct timezone *tzp
218);
219@end example
220
221@subheading STATUS CODES:
222
[f1ccfde]223On error, this routine returns -1 and sets @code{errno} as appropriate.
224
225@table @b
226@item EPERM
227@code{settimeofdat} is called by someone other than the superuser.
228
229@item EINVAL
230Timezone (or something else) is invalid.
231
232@item EFAULT
233One of @code{tv} or @code{tz} pointed outside your accessible address
234space
235
236@end table
[c247120a]237
238@subheading DESCRIPTION:
239
[f1ccfde]240This routine returns the current time of day in the @code{tp} structure.
241
[c247120a]242@subheading NOTES:
243
[f1ccfde]244Currently, the timezone information is not supported.  The @code{tzp}
245argument is ignored.
[c247120a]246
[6c914e9]247@page
[f1ccfde]248@subsection time - Get time in seconds
[6c914e9]249 
250@subheading CALLING SEQUENCE:
251 
252@example
253#include <time.h>
254 
255int time(
256  time_t  *tloc
257);
258@end example
259 
260@subheading STATUS CODES:
261
262This routine returns the number of seconds since the Epoch.
263
264@subheading DESCRIPTION:
[f1ccfde]265
266@code{time} returns the time since 00:00:00 GMT, January 1, 1970,
267measured in seconds
268
269If @code{tloc} in non null, the return value is also stored in the
270memory pointed to by @code{t}.
271 
272@subheading NOTES:
273
274NONE
275 
276@page
277@subsection times - Get process times
278 
279@subheading CALLING SEQUENCE:
280 
281@example
282#include <sys/time.h>
283 
284int time(
285  clock_t times(struct tms *buf
286);
287@end example
288 
289@subheading STATUS CODES:
290
291This routine returns the process times
292
293@subheading DESCRIPTION:
294
295@code{times} stores the current process times in @code{buf}.
296
[c11f512]297@code{struct tms} is as defined in @code{/usr/include/sys/times.h}
[f1ccfde]298
299@code{times} returns the number of clock ticks that have elapsed
300since the systm has been up.
[6c914e9]301 
302@subheading NOTES:
[d7fcc1d]303
304NONE
[6c914e9]305 
Note: See TracBrowser for help on using the repository browser.