source: rtems/doc/posix_users/clock.t @ 0660b4f8

4.104.114.84.95
Last change on this file since 0660b4f8 was 0660b4f8, checked in by Joel Sherrill <joel.sherrill@…>, on 11/16/99 at 19:50:56

Changed copyright date to 1999.

  • Property mode set to 100644
File size: 5.1 KB
RevLine 
[ae68ff0]1@c
[0660b4f8]2@c COPYRIGHT (c) 1988-1999.
[7479042]3@c On-Line Applications Research Corporation (OAR).
4@c All rights reserved.
[ae68ff0]5@c
[7479042]6@c $Id$
[139b2e4a]7@c
[ae68ff0]8
9@chapter Clock Manager
[c4dddee]10
[ae68ff0]11@section Introduction
12
13The clock manager ...
14
15The directives provided by the clock manager are:
16
17@itemize @bullet
[a518cc11]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
[c4dddee]21@item @code{sleep} - Delay Process Execution
[a518cc11]22@item @code{nanosleep} - Delay with High Resolution
[c4dddee]23@item @code{gettimeofday} - Get the Time of Day
24@item @code{time} - Get time in seconds
[ae68ff0]25@end itemize
26
27@section Background
28
[c4dddee]29There is currently no text in this section.
30
[ae68ff0]31@section Operations
32
[c4dddee]33There is currently no text in this section.
34
[ae68ff0]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
[a518cc11]42@subsection clock_gettime -Obtain Time of Day
[ae68ff0]43
[7479042]44@findex clock_gettime
45@cindex obtain time of day
46
[ae68ff0]47@subheading CALLING SEQUENCE:
48
49@example
50#include <time.h>
51
52int clock_gettime(
[7479042]53  clockid_t clock_id,
[ae68ff0]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
[7479042]64The tp pointer parameter is invalid.
[ae68ff0]65
66@item EINVAL
[7479042]67The clock_id specified is invalid.
[ae68ff0]68@end table
69
70@subheading DESCRIPTION:
71
72@subheading NOTES:
73
[c4dddee]74NONE
75
[7479042]76@c
77@c
78@c
[ae68ff0]79@page
[a518cc11]80@subsection clock_settime - Set Time of Day
[7479042]81
82@findex clock_settime
83@cindex  set time of day
84
[ae68ff0]85@subheading CALLING SEQUENCE:
[7479042]86
[ae68ff0]87@example
88#include <time.h>
[7479042]89
[ae68ff0]90int clock_settime(
[7479042]91  clockid_t clock_id,
[ae68ff0]92  const struct timespec *tp
93);
94@end example
[7479042]95
[ae68ff0]96@subheading STATUS CODES:
[7479042]97
[ae68ff0]98On error, this routine returns -1 and sets errno to one of the following:
99
100@table @b
101@item EINVAL
[7479042]102The tp pointer parameter is invalid.
[ae68ff0]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
[7479042]111
[ae68ff0]112@subheading DESCRIPTION:
[7479042]113
[ae68ff0]114@subheading NOTES:
[c4dddee]115
116NONE
[7479042]117
118@c
119@c
120@c
[ae68ff0]121@page
[a518cc11]122@subsection clock_getres - Get Clock Resolution
[7479042]123
124@findex clock_getres
125@cindex  get clock resolution
126
[ae68ff0]127@subheading CALLING SEQUENCE:
[7479042]128
[ae68ff0]129@example
130#include <time.h>
[7479042]131
[ae68ff0]132int clock_getres(
[7479042]133  clockid_t clock_id,
[ae68ff0]134  struct timespec *res
135);
136@end example
[7479042]137
[ae68ff0]138@subheading STATUS CODES:
[7479042]139
[ae68ff0]140On error, this routine returns -1 and sets errno to one of the following:
141
142@table @b
143@item EINVAL
[7479042]144The res pointer parameter is invalid.
[ae68ff0]145
146@item EINVAL
147The clock_id specified is invalid.
148
149@end table
[7479042]150
[ae68ff0]151@subheading DESCRIPTION:
[7479042]152
[ae68ff0]153@subheading NOTES:
[7479042]154
[ae68ff0]155If res is NULL, then the resolution is not returned.
156
[7479042]157@c
158@c
159@c
[ae68ff0]160@page
[c4dddee]161@subsection sleep - Delay Process Execution
[7479042]162
163@findex sleep
164@cindex  delay process execution
165
[ae68ff0]166@subheading CALLING SEQUENCE:
[7479042]167
[ae68ff0]168@example
169#include <time.h>
[7479042]170
[ae68ff0]171unsigned int sleep(
172  unsigned int seconds
173);
174@end example
[7479042]175
[ae68ff0]176@subheading STATUS CODES:
177
178This routine returns the number of unslept seconds.
179
180@subheading DESCRIPTION:
[7479042]181
[c4dddee]182The @code{sleep()} function delays the calling thread by the specified
183number of @code{seconds}.
184
[ae68ff0]185@subheading NOTES:
186
187This call is interruptible by a signal.
[7479042]188
189@c
190@c
191@c
[ae68ff0]192@page
[a518cc11]193@subsection nanosleep - Delay with High Resolution
[7479042]194
195@findex nanosleep
196@cindex  delay with high resolution
197
[ae68ff0]198@subheading CALLING SEQUENCE:
[7479042]199
[ae68ff0]200@example
201#include <time.h>
[7479042]202
[ae68ff0]203int nanosleep(
204  const struct timespec *rqtp,
[7479042]205  struct timespec *rmtp
[ae68ff0]206);
207@end example
[7479042]208
[ae68ff0]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
[7479042]225
[ae68ff0]226@subheading DESCRIPTION:
[7479042]227
[ae68ff0]228@subheading NOTES:
[7479042]229
[ae68ff0]230This call is interruptible by a signal.
231
[7479042]232@c
233@c
234@c
[ae68ff0]235@page
[c4dddee]236@subsection gettimeofday - Get the Time of Day
237
[7479042]238@findex gettimeofday
239@cindex  get the time of day
240
[c4dddee]241@subheading CALLING SEQUENCE:
242
243@example
244#include <sys/time.h>
245#include <unistd.h>
246
247int gettimeofday(
[7479042]248  struct timeval *tp,
[c4dddee]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
[7479042]265One of @code{tv} or @code{tz} pointed outside your accessible address
[c4dddee]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
[7479042]276Currently, the timezone information is not supported. The @code{tzp}
[c4dddee]277argument is ignored.
278
[7479042]279@c
280@c
281@c
[c4dddee]282@page
283@subsection time - Get time in seconds
[7479042]284
285@findex time
286@cindex  get time in seconds
287
[173c59c8]288@subheading CALLING SEQUENCE:
[7479042]289
[ae68ff0]290@example
291#include <time.h>
[7479042]292
[ae68ff0]293int time(
[7479042]294  time_t *tloc
[ae68ff0]295);
296@end example
[7479042]297
[ae68ff0]298@subheading STATUS CODES:
299
300This routine returns the number of seconds since the Epoch.
301
302@subheading DESCRIPTION:
[c4dddee]303
[7479042]304@code{time} returns the time since 00:00:00 GMT, January 1, 1970,
[c4dddee]305measured in seconds
306
[7479042]307If @code{tloc} in non null, the return value is also stored in the
[c4dddee]308memory pointed to by @code{t}.
[7479042]309
[ae68ff0]310@subheading NOTES:
[c4dddee]311
312NONE
[7479042]313
Note: See TracBrowser for help on using the repository browser.