source: rtems/doc/posix_users/clock.t @ c4dddee

4.104.114.84.95
Last change on this file since c4dddee was c4dddee, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 19, 1998 at 4:06:46 PM

Major update/merge of POSIX manual.

  • Property mode set to 100644
File size: 4.6 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} - 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 -
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 - Get the Time of Day
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 @code{errno} as appropriate.
223
224@table @b
225@item EPERM
226@code{settimeofdat} is called by someone other than the superuser.
227
228@item EINVAL
229Timezone (or something else) is invalid.
230
231@item EFAULT
232One of @code{tv} or @code{tz} pointed outside your accessible address
233space
234
235@end table
236
237@subheading DESCRIPTION:
238
239This routine returns the current time of day in the @code{tp} structure.
240
241@subheading NOTES:
242
243Currently, the timezone information is not supported.  The @code{tzp}
244argument is ignored.
245
246@page
247@subsection time - Get time in seconds
248 
249@subheading CALLING SEQUENCE:
250 
251@example
252#include <time.h>
253 
254int time(
255  time_t  *tloc
256);
257@end example
258 
259@subheading STATUS CODES:
260
261This routine returns the number of seconds since the Epoch.
262
263@subheading DESCRIPTION:
264
265@code{time} returns the time since 00:00:00 GMT, January 1, 1970,
266measured in seconds
267
268If @code{tloc} in non null, the return value is also stored in the
269memory pointed to by @code{t}.
270 
271@subheading NOTES:
272
273NONE
274 
Note: See TracBrowser for help on using the repository browser.