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

4.104.114.84.95
Last change on this file since c247120 was c247120, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 9, 1998 at 6:09:02 PM

Added gettimeofday().

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