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