source: rtems/doc/new_chapters/clock.texi @ 139b2e4a

4.104.114.84.95
Last change on this file since 139b2e4a was 139b2e4a, checked in by Joel Sherrill <joel.sherrill@…>, on 06/04/97 at 18:32:07

added CVS Id string

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