Debian Codegraph @

templates/man2/clock_getres.2.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:20+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "clock_getres"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
28 #, no-wrap
29 msgid "2026-03-07"
30 msgstr ""
31
32 #. type: TH
33 #: archlinux debian-unstable
34 #, no-wrap
35 msgid "Linux man-pages 6.18"
36 msgstr ""
37
38 #. type: SH
39 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
40 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
41 #, no-wrap
42 msgid "NAME"
43 msgstr ""
44
45 #. type: Plain text
46 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
47 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
48 msgid "clock_getres, clock_gettime, clock_settime - clock and time functions"
49 msgstr ""
50
51 #. type: SH
52 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
53 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
54 #, no-wrap
55 msgid "LIBRARY"
56 msgstr ""
57
58 #. type: Plain text
59 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
60 #: opensuse-leap-16-1 opensuse-tumbleweed
61 msgid "Standard C library (I<libc>,\\ I<-lc>), since glibc 2.17"
62 msgstr ""
63
64 #. type: Plain text
65 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
66 #: opensuse-leap-16-1 opensuse-tumbleweed
67 msgid "Before glibc 2.17, Real-time library (I<librt>,\\ I<-lrt>)"
68 msgstr ""
69
70 #. type: SH
71 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
72 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
73 #, no-wrap
74 msgid "SYNOPSIS"
75 msgstr ""
76
77 #. type: Plain text
78 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
79 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
80 #, no-wrap
81 msgid "B<#include E<lt>time.hE<gt>>\n"
82 msgstr ""
83
84 #. type: Plain text
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 #, no-wrap
88 msgid "B<int clock_getres(clockid_t >I<clockid>B<, struct timespec *_Nullable >I<res>B<);>\n"
89 msgstr ""
90
91 #. type: Plain text
92 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
93 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
94 #, no-wrap
95 msgid ""
96 "B<int clock_gettime(clockid_t >I<clockid>B<, struct timespec *>I<tp>B<);>\n"
97 "B<int clock_settime(clockid_t >I<clockid>B<, const struct timespec *>I<tp>B<);>\n"
98 msgstr ""
99
100 #. type: Plain text
101 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
102 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
103 msgid ""
104 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
105 msgstr ""
106
107 #. type: Plain text
108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
110 msgid "B<clock_getres>(), B<clock_gettime>(), B<clock_settime>():"
111 msgstr ""
112
113 #. type: Plain text
114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
116 #, no-wrap
117 msgid " _POSIX_C_SOURCE E<gt>= 199309L\n"
118 msgstr ""
119
120 #. type: SH
121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
123 #, no-wrap
124 msgid "DESCRIPTION"
125 msgstr ""
126
127 #. type: Plain text
128 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
129 #: opensuse-tumbleweed
130 msgid ""
131 "The function B<clock_getres>() finds the resolution (precision) of the "
132 "specified clock I<clockid>, and, if I<res> is non-NULL, stores it in the "
133 "I<struct\\ timespec> pointed to by I<res>. The resolution of clocks depends "
134 "on the implementation and cannot be configured by a particular process. If "
135 "the time value pointed to by the argument I<tp> of B<clock_settime>() is "
136 "not a multiple of I<res>, then it is truncated to a multiple of I<res>."
137 msgstr ""
138
139 #. type: Plain text
140 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
141 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
142 msgid ""
143 "The functions B<clock_gettime>() and B<clock_settime>() retrieve and set "
144 "the time of the specified clock I<clockid>."
145 msgstr ""
146
147 #. type: Plain text
148 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
149 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
150 msgid "The I<res> and I<tp> arguments are B<timespec>(3) structures."
151 msgstr ""
152
153 #. type: Plain text
154 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
155 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
156 msgid ""
157 "The I<clockid> argument is the identifier of the particular clock on which "
158 "to act. A clock may be system-wide and hence visible for all processes, or "
159 "per-process if it measures time only within a single process."
160 msgstr ""
161
162 #. type: Plain text
163 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
164 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
165 msgid ""
166 "All implementations support the system-wide real-time clock, which is "
167 "identified by B<CLOCK_REALTIME>. Its time represents seconds and "
168 "nanoseconds since the Epoch. When its time is changed, timers for a "
169 "relative interval are unaffected, but timers for an absolute point in time "
170 "are affected."
171 msgstr ""
172
173 #. type: Plain text
174 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
175 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
176 msgid ""
177 "More clocks may be implemented. The interpretation of the corresponding "
178 "time values and the effect on timers is unspecified."
179 msgstr ""
180
181 #. type: Plain text
182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
184 msgid ""
185 "Sufficiently recent versions of glibc and the Linux kernel support the "
186 "following clocks:"
187 msgstr ""
188
189 #. type: TP
190 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
191 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
192 #, no-wrap
193 msgid "B<CLOCK_REALTIME>"
194 msgstr ""
195
196 #. type: Plain text
197 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
198 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
199 msgid ""
200 "A settable system-wide clock that measures real (i.e., wall-clock) time. "
201 "Setting this clock requires appropriate privileges. This clock is affected "
202 "by discontinuous jumps in the system time (e.g., if the system administrator "
203 "manually changes the clock), and by frequency adjustments performed by NTP "
204 "and similar applications via B<adjtime>(3), B<adjtimex>(2), "
205 "B<clock_adjtime>(2), and B<ntp_adjtime>(3). This clock normally counts the "
206 "number of seconds since 1970-01-01 00:00:00 Coordinated Universal Time "
207 "(UTC) except that it ignores leap seconds; near a leap second it is "
208 "typically adjusted by NTP to stay roughly in sync with UTC."
209 msgstr ""
210
211 #. type: TP
212 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
213 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
214 #, no-wrap
215 msgid "B<CLOCK_REALTIME_ALARM> (since Linux 3.0; Linux-specific)"
216 msgstr ""
217
218 #. type: Plain text
219 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
220 msgid ""
221 "Like B<CLOCK_REALTIME>, but settable only indirectly by setting "
222 "B<CLOCK_REALTIME>, and behaves differently if the system is suspended. See "
223 "B<timer_create>(2)."
224 msgstr ""
225
226 #. type: TP
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 #, no-wrap
230 msgid "B<CLOCK_REALTIME_COARSE> (since Linux 2.6.32; Linux-specific)"
231 msgstr ""
232
233 #. Added in commit da15cfdae03351c689736f8d142618592e3cebc3
234 #. type: Plain text
235 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
236 msgid ""
237 "A faster but less precise version of B<CLOCK_REALTIME>. It is settable only "
238 "indirectly by setting B<CLOCK_REALTIME>. Use when you need very fast, but "
239 "not fine-grained timestamps. Requires per-architecture support, and "
240 "probably also architecture support for this flag in the B<vdso>(7)."
241 msgstr ""
242
243 #. type: TP
244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
246 #, no-wrap
247 msgid "B<CLOCK_TAI> (since Linux 3.10; Linux-specific)"
248 msgstr ""
249
250 #. commit 1ff3c9677bff7e468e0c487d0ffefe4e901d33f4
251 #. type: Plain text
252 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
253 msgid ""
254 "A system-wide clock derived from wall-clock time but counting leap seconds. "
255 "This clock does not experience clock adjustments caused by inserting leap "
256 "seconds as B<CLOCK_REALTIME> does. It counts seconds since 1970-01-01 00:00 "
257 "TAI (1969-12-31 23:59:50 UTC), so its epoch is ten seconds before "
258 "B<CLOCK_REALTIME>'s. However, its implementation requires help from NTP, "
259 "and if that help is not available it behaves like B<CLOCK_REALTIME> instead."
260 msgstr ""
261
262 #. type: Plain text
263 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
264 msgid ""
265 "Its relationship to B<CLOCK_REALTIME> for timestamps before 1972 is only "
266 "approximate, as the leap second regime was introduced on 1972-01-01. "
267 "Because leap seconds are planned to be discontinued, its value from now on "
268 "will likely remain exactly 37 seconds greater than B<CLOCK_REALTIME>'s for "
269 "many years, after which its offset from B<CLOCK_REALTIME>'s will likely be "
270 "adjusted by some other mechanism as yet unspecified. It is settable only "
271 "indirectly by setting B<CLOCK_REALTIME>."
272 msgstr ""
273
274 #. type: Plain text
275 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
276 msgid ""
277 "The acronym TAI stands for the French \"temps atomique international\", or "
278 "International Atomic Time."
279 msgstr ""
280
281 #. type: TP
282 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
283 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
284 #, no-wrap
285 msgid "B<CLOCK_MONOTONIC>"
286 msgstr ""
287
288 #. type: Plain text
289 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
290 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
291 msgid ""
292 "A nonsettable system-wide clock that represents monotonic time since\\[em]as "
293 "described by POSIX\\[em]\"some unspecified point in the past\". On Linux, "
294 "that point corresponds to the number of seconds that the system has been "
295 "running since it was booted."
296 msgstr ""
297
298 #. type: Plain text
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 msgid ""
302 "The B<CLOCK_MONOTONIC> clock is not affected by discontinuous jumps in the "
303 "system time (e.g., if the system administrator manually changes the clock), "
304 "but is affected by frequency adjustments. This clock does not count time "
305 "that the system is suspended. All B<CLOCK_MONOTONIC> variants guarantee "
306 "that the time returned by consecutive calls will not go backwards, but "
307 "successive calls may\\[em]depending on the architecture\\[em]return "
308 "identical (not-increased) time values."
309 msgstr ""
310
311 #. type: TP
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 #, no-wrap
315 msgid "B<CLOCK_MONOTONIC_COARSE> (since Linux 2.6.32; Linux-specific)"
316 msgstr ""
317
318 #. Added in commit da15cfdae03351c689736f8d142618592e3cebc3
319 #. type: Plain text
320 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
321 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
322 msgid ""
323 "A faster but less precise version of B<CLOCK_MONOTONIC>. Use when you need "
324 "very fast, but not fine-grained timestamps. Requires per-architecture "
325 "support, and probably also architecture support for this flag in the "
326 "B<vdso>(7)."
327 msgstr ""
328
329 #. type: TP
330 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
331 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
332 #, no-wrap
333 msgid "B<CLOCK_MONOTONIC_RAW> (since Linux 2.6.28; Linux-specific)"
334 msgstr ""
335
336 #. Added in commit 2d42244ae71d6c7b0884b5664cf2eda30fb2ae68, John Stultz
337 #. type: Plain text
338 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
339 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
340 msgid ""
341 "Similar to B<CLOCK_MONOTONIC>, but provides access to a raw hardware-based "
342 "time that is not subject to frequency adjustments. This clock does not "
343 "count time that the system is suspended."
344 msgstr ""
345
346 #. type: TP
347 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
348 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
349 #, no-wrap
350 msgid "B<CLOCK_BOOTTIME> (since Linux 2.6.39; Linux-specific)"
351 msgstr ""
352
353 #. commit 7fdd7f89006dd5a4c702fa0ce0c272345fa44ae0
354 #. commit 70a08cca1227dc31c784ec930099a4417a06e7d0
355 #. type: Plain text
356 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
357 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
358 msgid ""
359 "A nonsettable system-wide clock that is identical to B<CLOCK_MONOTONIC>, "
360 "except that it also includes any time that the system is suspended. This "
361 "allows applications to get a suspend-aware monotonic clock without having to "
362 "deal with the complications of B<CLOCK_REALTIME>, which may have "
363 "discontinuities if the time is changed using B<settimeofday>(2) or similar."
364 msgstr ""
365
366 #. type: TP
367 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
368 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
369 #, no-wrap
370 msgid "B<CLOCK_BOOTTIME_ALARM> (since Linux 3.0; Linux-specific)"
371 msgstr ""
372
373 #. type: Plain text
374 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
375 msgid ""
376 "Like B<CLOCK_BOOTTIME>, but behaves differently if the system is suspended. "
377 "See B<timer_create>(2)."
378 msgstr ""
379
380 #. type: TP
381 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
382 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
383 #, no-wrap
384 msgid "B<CLOCK_PROCESS_CPUTIME_ID> (since Linux 2.6.12)"
385 msgstr ""
386
387 #. type: Plain text
388 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
389 msgid ""
390 "This clock measures CPU time consumed by this process (i.e., CPU time "
391 "consumed by all threads in the process). On Linux, this clock is not "
392 "settable."
393 msgstr ""
394
395 #. type: TP
396 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
397 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
398 #, no-wrap
399 msgid "B<CLOCK_THREAD_CPUTIME_ID> (since Linux 2.6.12)"
400 msgstr ""
401
402 #. type: Plain text
403 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
404 msgid ""
405 "This clock measures CPU time consumed by this thread. On Linux, this clock "
406 "is not settable."
407 msgstr ""
408
409 #. type: Plain text
410 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
411 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
412 msgid "Linux also implements dynamic clock instances as described below."
413 msgstr ""
414
415 #. type: SS
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 #, no-wrap
419 msgid "Dynamic clocks"
420 msgstr ""
421
422 #. type: Plain text
423 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
424 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
425 msgid ""
426 "In addition to the hard-coded System-V style clock IDs described above, "
427 "Linux also supports POSIX clock operations on certain character devices. "
428 "Such devices are called \"dynamic\" clocks, and are supported since Linux "
429 "2.6.39."
430 msgstr ""
431
432 #. type: Plain text
433 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
434 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
435 msgid ""
436 "Using the appropriate macros, open file descriptors may be converted into "
437 "clock IDs and passed to B<clock_gettime>(), B<clock_settime>(), and "
438 "B<clock_adjtime>(2). The following example shows how to convert a file "
439 "descriptor into a dynamic clock ID."
440 msgstr ""
441
442 #. type: Plain text
443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
445 #, no-wrap
446 msgid ""
447 "#define CLOCKFD 3\n"
448 "#define FD_TO_CLOCKID(fd) ((\\[ti](clockid_t) (fd) E<lt>E<lt> 3) | CLOCKFD)\n"
449 "#define CLOCKID_TO_FD(clk) ((unsigned int) \\[ti]((clk) E<gt>E<gt> 3))\n"
450 "\\&\n"
451 "struct timespec ts;\n"
452 "clockid_t clkid;\n"
453 "int fd;\n"
454 "\\&\n"
455 "fd = open(\"/dev/ptp0\", O_RDWR);\n"
456 "clkid = FD_TO_CLOCKID(fd);\n"
457 "clock_gettime(clkid, &ts);\n"
458 msgstr ""
459
460 #. type: SH
461 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
462 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
463 #, no-wrap
464 msgid "RETURN VALUE"
465 msgstr ""
466
467 #. type: Plain text
468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
470 msgid ""
471 "B<clock_gettime>(), B<clock_settime>(), and B<clock_getres>() return 0 for "
472 "success. On error, -1 is returned and I<errno> is set to indicate the error."
473 msgstr ""
474
475 #. type: SH
476 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
477 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
478 #, no-wrap
479 msgid "ERRORS"
480 msgstr ""
481
482 #. type: TP
483 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
484 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
485 #, no-wrap
486 msgid "B<EACCES>"
487 msgstr ""
488
489 #. type: Plain text
490 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
491 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
492 msgid ""
493 "B<clock_settime>() does not have write permission for the dynamic POSIX "
494 "clock device indicated."
495 msgstr ""
496
497 #. type: TP
498 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
499 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
500 #, no-wrap
501 msgid "B<EFAULT>"
502 msgstr ""
503
504 #. type: Plain text
505 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
506 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
507 msgid "I<tp> points outside the accessible address space."
508 msgstr ""
509
510 #. type: TP
511 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
512 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
513 #, no-wrap
514 msgid "B<EINVAL>"
515 msgstr ""
516
517 #. Linux also gives this error on attempts to set CLOCK_PROCESS_CPUTIME_ID
518 #. and CLOCK_THREAD_CPUTIME_ID, when probably the proper error should be
519 #. EPERM.
520 #. type: Plain text
521 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
522 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
523 msgid ""
524 "The I<clockid> specified is invalid for one of two reasons. Either the "
525 "System-V style hard coded positive value is out of range, or the dynamic "
526 "clock ID does not refer to a valid instance of a clock object."
527 msgstr ""
528
529 #. type: Plain text
530 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
531 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
532 msgid ""
533 "(B<clock_settime>()): I<tp.tv_sec> is negative or I<tp.tv_nsec> is outside "
534 "the range [0, 999,999,999]."
535 msgstr ""
536
537 #. type: Plain text
538 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
539 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
540 msgid ""
541 "The I<clockid> specified in a call to B<clock_settime>() is not a settable "
542 "clock."
543 msgstr ""
544
545 #. type: TP
546 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
547 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
548 #, no-wrap
549 msgid "B<EINVAL> (since Linux 4.3)"
550 msgstr ""
551
552 #. commit e1d7ba8735551ed79c7a0463a042353574b96da3
553 #. type: Plain text
554 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
555 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
556 msgid ""
557 "A call to B<clock_settime>() with a I<clockid> of B<CLOCK_REALTIME> "
558 "attempted to set the time to a value less than the current value of the "
559 "B<CLOCK_MONOTONIC> clock."
560 msgstr ""
561
562 #. type: TP
563 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
564 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
565 #, no-wrap
566 msgid "B<ENODEV>"
567 msgstr ""
568
569 #. type: Plain text
570 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
571 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
572 msgid ""
573 "The hot-pluggable device (like USB for example) represented by a dynamic "
574 "I<clk_id> has disappeared after its character device was opened."
575 msgstr ""
576
577 #. type: TP
578 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
579 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
580 #, no-wrap
581 msgid "B<ENOTSUP>"
582 msgstr ""
583
584 #. type: Plain text
585 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
586 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
587 msgid ""
588 "The operation is not supported by the dynamic POSIX clock device specified."
589 msgstr ""
590
591 #. type: TP
592 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
593 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
594 #, no-wrap
595 msgid "B<EOVERFLOW>"
596 msgstr ""
597
598 #. type: Plain text
599 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
600 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
601 msgid ""
602 "The timestamp would not fit in I<time_t> range. This can happen if an "
603 "executable with 32-bit I<time_t> is run on a 64-bit kernel when the time is "
604 "2038-01-19 03:14:08 UTC or later. However, when the system time is out of "
605 "I<time_t> range in other situations, the behavior is undefined."
606 msgstr ""
607
608 #. type: TP
609 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
610 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
611 #, no-wrap
612 msgid "B<EPERM>"
613 msgstr ""
614
615 #. type: Plain text
616 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
617 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
618 msgid ""
619 "B<clock_settime>() does not have permission to set the clock indicated."
620 msgstr ""
621
622 #. type: SH
623 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
624 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
625 #, no-wrap
626 msgid "ATTRIBUTES"
627 msgstr ""
628
629 #. type: Plain text
630 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
631 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
632 msgid ""
633 "For an explanation of the terms used in this section, see B<attributes>(7)."
634 msgstr ""
635
636 #. type: tbl table
637 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
638 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
639 #, no-wrap
640 msgid "Interface"
641 msgstr ""
642
643 #. type: tbl table
644 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
645 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
646 #, no-wrap
647 msgid "Attribute"
648 msgstr ""
649
650 #. type: tbl table
651 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
652 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
653 #, no-wrap
654 msgid "Value"
655 msgstr ""
656
657 #. type: tbl table
658 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
659 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
660 #, no-wrap
661 msgid ".na\n"
662 msgstr ""
663
664 #. type: tbl table
665 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
666 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
667 #, no-wrap
668 msgid ".nh\n"
669 msgstr ""
670
671 #. type: tbl table
672 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
673 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
674 #, no-wrap
675 msgid ""
676 "B<clock_getres>(),\n"
677 "B<clock_gettime>(),\n"
678 "B<clock_settime>()"
679 msgstr ""
680
681 #. type: tbl table
682 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
683 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
684 #, no-wrap
685 msgid "Thread safety"
686 msgstr ""
687
688 #. type: tbl table
689 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
690 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
691 #, no-wrap
692 msgid "MT-Safe"
693 msgstr ""
694
695 #. type: SH
696 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
697 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
698 #, no-wrap
699 msgid "VERSIONS"
700 msgstr ""
701
702 #. type: Plain text
703 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
704 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
705 msgid "POSIX.1 specifies the following:"
706 msgstr ""
707
708 #. type: Plain text
709 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
710 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
711 msgid ""
712 "Setting the value of the B<CLOCK_REALTIME> clock via B<clock_settime>() "
713 "shall have no effect on threads that are blocked waiting for a relative time "
714 "service based upon this clock, including the B<nanosleep>() function; nor "
715 "on the expiration of relative timers based upon this clock. Consequently, "
716 "these time services shall expire when the requested relative interval "
717 "elapses, independently of the new or old value of the clock."
718 msgstr ""
719
720 #. See http://bugzilla.kernel.org/show_bug.cgi?id=11972
721 #. type: Plain text
722 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
723 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
724 msgid ""
725 "According to POSIX.1-2001, a process with \"appropriate privileges\" may set "
726 "the B<CLOCK_PROCESS_CPUTIME_ID> and B<CLOCK_THREAD_CPUTIME_ID> clocks using "
727 "B<clock_settime>(). On Linux, these clocks are not settable (i.e., no "
728 "process has \"appropriate privileges\")."
729 msgstr ""
730
731 #. type: SS
732 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
733 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
734 #, no-wrap
735 msgid "C library/kernel differences"
736 msgstr ""
737
738 #. type: Plain text
739 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
740 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
741 msgid ""
742 "On some architectures, an implementation of B<clock_gettime>() is provided "
743 "in the B<vdso>(7)."
744 msgstr ""
745
746 #. type: SH
747 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
748 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
749 #, no-wrap
750 msgid "STANDARDS"
751 msgstr ""
752
753 #. type: Plain text
754 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
755 #: opensuse-tumbleweed
756 msgid "POSIX.1-2024."
757 msgstr ""
758
759 #. type: SH
760 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
761 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
762 #, no-wrap
763 msgid "HISTORY"
764 msgstr ""
765
766 #. type: Plain text
767 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
768 #: opensuse-tumbleweed
769 msgid "POSIX.1-1996, Linux 2.6."
770 msgstr ""
771
772 #. type: Plain text
773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
775 msgid ""
776 "On POSIX systems on which these functions are available, the symbol "
777 "B<_POSIX_TIMERS> is defined in I<E<lt>unistd.hE<gt>> to a value greater than "
778 "0. POSIX.1-2008 makes these functions mandatory."
779 msgstr ""
780
781 #. type: Plain text
782 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
783 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
784 msgid ""
785 "The symbols B<_POSIX_MONOTONIC_CLOCK>, B<_POSIX_CPUTIME>, "
786 "B<_POSIX_THREAD_CPUTIME> indicate that B<CLOCK_MONOTONIC>, "
787 "B<CLOCK_PROCESS_CPUTIME_ID>, B<CLOCK_THREAD_CPUTIME_ID> are available. (See "
788 "also B<sysconf>(3).)"
789 msgstr ""
790
791 #. type: Plain text
792 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
793 #: opensuse-tumbleweed
794 msgid "POSIX.1-2024 made B<CLOCK_MONOTONIC> mandatory."
795 msgstr ""
796
797 #. type: SS
798 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
799 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
800 #, no-wrap
801 msgid "Historical note for SMP systems"
802 msgstr ""
803
804 #. type: Plain text
805 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
806 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
807 msgid ""
808 "Before Linux added kernel support for B<CLOCK_PROCESS_CPUTIME_ID> and "
809 "B<CLOCK_THREAD_CPUTIME_ID>, glibc implemented these clocks on many platforms "
810 "using timer registers from the CPUs (TSC on i386, AR.ITC on Itanium). These "
811 "registers may differ between CPUs and as a consequence these clocks may "
812 "return B<bogus results> if a process is migrated to another CPU."
813 msgstr ""
814
815 #. type: Plain text
816 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
817 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
818 msgid ""
819 "If the CPUs in an SMP system have different clock sources, then there is no "
820 "way to maintain a correlation between the timer registers since each CPU "
821 "will run at a slightly different frequency. If that is the case, then "
822 "I<clock_getcpuclockid(0)> will return B<ENOENT> to signify this condition. "
823 "The two clocks will then be useful only if it can be ensured that a process "
824 "stays on a certain CPU."
825 msgstr ""
826
827 #. type: Plain text
828 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
829 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
830 msgid ""
831 "The processors in an SMP system do not start all at exactly the same time "
832 "and therefore the timer registers are typically running at an offset. Some "
833 "architectures include code that attempts to limit these offsets on bootup. "
834 "However, the code cannot guarantee to accurately tune the offsets. glibc "
835 "contains no provisions to deal with these offsets (unlike the Linux "
836 "Kernel). Typically these offsets are small and therefore the effects may be "
837 "negligible in most cases."
838 msgstr ""
839
840 #. type: Plain text
841 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
842 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
843 msgid ""
844 "Since glibc 2.4, the wrapper functions for the system calls described in "
845 "this page avoid the abovementioned problems by employing the kernel "
846 "implementation of B<CLOCK_PROCESS_CPUTIME_ID> and "
847 "B<CLOCK_THREAD_CPUTIME_ID>, on systems that provide such an implementation "
848 "(i.e., Linux 2.6.12 and later)."
849 msgstr ""
850
851 #. type: SH
852 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
853 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
854 #, no-wrap
855 msgid "EXAMPLES"
856 msgstr ""
857
858 #. type: Plain text
859 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
860 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
861 msgid ""
862 "The program below demonstrates the use of B<clock_gettime>() and "
863 "B<clock_getres>() with various clocks. This is an example of what we might "
864 "see when running the program:"
865 msgstr ""
866
867 #. type: Plain text
868 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
869 #: opensuse-tumbleweed
870 #, no-wrap
871 msgid ""
872 "$B< ./clock_times x>;\n"
873 "CLOCK_REALTIME : 1585985459.446 (18356 days + 7h 30m 59s)\n"
874 " resolution: 0.000000001\n"
875 "CLOCK_TAI : 1585985496.447 (18356 days + 7h 31m 36s)\n"
876 " resolution: 0.000000001\n"
877 "CLOCK_MONOTONIC: 52395.722 (14h 33m 15s)\n"
878 " resolution: 0.000000001\n"
879 "CLOCK_BOOTTIME : 72691.019 (20h 11m 31s)\n"
880 " resolution: 0.000000001\n"
881 msgstr ""
882
883 #. type: SS
884 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
885 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
886 #, no-wrap
887 msgid "Program source"
888 msgstr ""
889
890 #. type: Plain text
891 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
892 #: opensuse-tumbleweed
893 #, no-wrap
894 msgid ""
895 "/* clock_times.c\n"
896 "\\&\n"
897 " Licensed under GNU General Public License v2 or later.\n"
898 "*/\n"
899 "#define _XOPEN_SOURCE 600\n"
900 "#include E<lt>stdbool.hE<gt>\n"
901 "#include E<lt>stdint.hE<gt>\n"
902 "#include E<lt>stdio.hE<gt>\n"
903 "#include E<lt>stdlib.hE<gt>\n"
904 "#include E<lt>sys/types.hE<gt>\n"
905 "#include E<lt>time.hE<gt>\n"
906 "\\&\n"
907 "#define SECS_IN_DAY (24 * 60 * 60)\n"
908 "\\&\n"
909 "static void\n"
910 "displayClock(clockid_t clock, const char *name, bool showRes)\n"
911 "{\n"
912 " long days;\n"
913 " struct timespec ts;\n"
914 "\\&\n"
915 " if (clock_gettime(clock, &ts) == -1) {\n"
916 " perror(\"clock_gettime\");\n"
917 " exit(EXIT_FAILURE);\n"
918 " }\n"
919 "\\&\n"
920 " printf(\"%-15s: %10jd.%03ld (\", name,\n"
921 " (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n"
922 "\\&\n"
923 " days = ts.tv_sec / SECS_IN_DAY;\n"
924 " if (days E<gt> 0)\n"
925 " printf(\"%ld days + \", days);\n"
926 "\\&\n"
927 " printf(\"%2dh %2dm %2ds\",\n"
928 " (int) (ts.tv_sec % SECS_IN_DAY) / 3600,\n"
929 " (int) (ts.tv_sec % 3600) / 60,\n"
930 " (int) ts.tv_sec % 60);\n"
931 " printf(\")\\[rs]n\");\n"
932 "\\&\n"
933 " if (clock_getres(clock, &ts) == -1) {\n"
934 " perror(\"clock_getres\");\n"
935 " exit(EXIT_FAILURE);\n"
936 " }\n"
937 "\\&\n"
938 " if (showRes)\n"
939 " printf(\" resolution: %10jd.%09ld\\[rs]n\",\n"
940 " (intmax_t) ts.tv_sec, ts.tv_nsec);\n"
941 "}\n"
942 "\\&\n"
943 "int\n"
944 "main(int argc, char *[])\n"
945 "{\n"
946 " bool showRes = argc E<gt> 1;\n"
947 "\\&\n"
948 " displayClock(CLOCK_REALTIME, \"CLOCK_REALTIME\", showRes);\n"
949 "#ifdef CLOCK_TAI\n"
950 " displayClock(CLOCK_TAI, \"CLOCK_TAI\", showRes);\n"
951 "#endif\n"
952 " displayClock(CLOCK_MONOTONIC, \"CLOCK_MONOTONIC\", showRes);\n"
953 "#ifdef CLOCK_BOOTTIME\n"
954 " displayClock(CLOCK_BOOTTIME, \"CLOCK_BOOTTIME\", showRes);\n"
955 "#endif\n"
956 " exit(EXIT_SUCCESS);\n"
957 "}\n"
958 msgstr ""
959
960 #. SRC END
961 #. type: SH
962 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
963 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
964 #, no-wrap
965 msgid "SEE ALSO"
966 msgstr ""
967
968 #. type: Plain text
969 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
970 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
971 msgid ""
972 "B<date>(1), B<gettimeofday>(2), B<settimeofday>(2), B<time>(2), "
973 "B<adjtime>(3), B<clock_getcpuclockid>(3), B<ctime>(3), B<ftime>(3), "
974 "B<pthread_getcpuclockid>(3), B<sysconf>(3), B<timespec>(3), B<time>(7), "
975 "B<time_namespaces>(7), B<vdso>(7), B<hwclock>(8)"
976 msgstr ""
977
978 #. type: TH
979 #: debian-trixie
980 #, no-wrap
981 msgid "2024-06-15"
982 msgstr ""
983
984 #. type: TH
985 #: debian-trixie
986 #, no-wrap
987 msgid "Linux man-pages 6.9.1"
988 msgstr ""
989
990 #. type: Plain text
991 #: debian-trixie
992 msgid "Standard C library (I<libc>, I<-lc>), since glibc 2.17"
993 msgstr ""
994
995 #. type: Plain text
996 #: debian-trixie
997 msgid "Before glibc 2.17, Real-time library (I<librt>, I<-lrt>)"
998 msgstr ""
999
1000 #. type: Plain text
1001 #: debian-trixie fedora-44 fedora-rawhide
1002 msgid ""
1003 "The function B<clock_getres>() finds the resolution (precision) of the "
1004 "specified clock I<clockid>, and, if I<res> is non-NULL, stores it in the "
1005 "I<struct timespec> pointed to by I<res>. The resolution of clocks depends "
1006 "on the implementation and cannot be configured by a particular process. If "
1007 "the time value pointed to by the argument I<tp> of B<clock_settime>() is "
1008 "not a multiple of I<res>, then it is truncated to a multiple of I<res>."
1009 msgstr ""
1010
1011 #. type: Plain text
1012 #: debian-trixie fedora-44 fedora-rawhide mageia-cauldron
1013 msgid ""
1014 "Like B<CLOCK_REALTIME>, but not settable. See B<timer_create>(2) for "
1015 "further details."
1016 msgstr ""
1017
1018 #. Added in commit da15cfdae03351c689736f8d142618592e3cebc3
1019 #. type: Plain text
1020 #: debian-trixie fedora-44 fedora-rawhide mageia-cauldron
1021 msgid ""
1022 "A faster but less precise version of B<CLOCK_REALTIME>. This clock is not "
1023 "settable. Use when you need very fast, but not fine-grained timestamps. "
1024 "Requires per-architecture support, and probably also architecture support "
1025 "for this flag in the B<vdso>(7)."
1026 msgstr ""
1027
1028 #. commit 1ff3c9677bff7e468e0c487d0ffefe4e901d33f4
1029 #. type: Plain text
1030 #: debian-trixie fedora-44 fedora-rawhide mageia-cauldron
1031 msgid ""
1032 "A nonsettable system-wide clock derived from wall-clock time but counting "
1033 "leap seconds. This clock does not experience discontinuities or frequency "
1034 "adjustments caused by inserting leap seconds as B<CLOCK_REALTIME> does."
1035 msgstr ""
1036
1037 #. type: Plain text
1038 #: debian-trixie fedora-44 fedora-rawhide mageia-cauldron
1039 msgid "The acronym TAI refers to International Atomic Time."
1040 msgstr ""
1041
1042 #. type: Plain text
1043 #: debian-trixie fedora-44 fedora-rawhide mageia-cauldron
1044 msgid "Like B<CLOCK_BOOTTIME>. See B<timer_create>(2) for further details."
1045 msgstr ""
1046
1047 #. type: Plain text
1048 #: debian-trixie fedora-44 fedora-rawhide mageia-cauldron
1049 msgid ""
1050 "This is a clock that measures CPU time consumed by this process (i.e., CPU "
1051 "time consumed by all threads in the process). On Linux, this clock is not "
1052 "settable."
1053 msgstr ""
1054
1055 #. type: Plain text
1056 #: debian-trixie fedora-44 fedora-rawhide mageia-cauldron
1057 msgid ""
1058 "This is a clock that measures CPU time consumed by this thread. On Linux, "
1059 "this clock is not settable."
1060 msgstr ""
1061
1062 #. type: Plain text
1063 #: debian-trixie fedora-44 fedora-rawhide
1064 msgid "POSIX.1-2008."
1065 msgstr ""
1066
1067 #. type: Plain text
1068 #: debian-trixie fedora-44 fedora-rawhide
1069 msgid "POSIX.1-2001, SUSv2. Linux 2.6."
1070 msgstr ""
1071
1072 #. type: Plain text
1073 #: debian-trixie fedora-44 fedora-rawhide
1074 #, no-wrap
1075 msgid ""
1076 "$ B<./clock_times x>\n"
1077 "CLOCK_REALTIME : 1585985459.446 (18356 days + 7h 30m 59s)\n"
1078 " resolution: 0.000000001\n"
1079 "CLOCK_TAI : 1585985496.447 (18356 days + 7h 31m 36s)\n"
1080 " resolution: 0.000000001\n"
1081 "CLOCK_MONOTONIC: 52395.722 (14h 33m 15s)\n"
1082 " resolution: 0.000000001\n"
1083 "CLOCK_BOOTTIME : 72691.019 (20h 11m 31s)\n"
1084 " resolution: 0.000000001\n"
1085 msgstr ""
1086
1087 #. type: Plain text
1088 #: debian-trixie
1089 #, no-wrap
1090 msgid ""
1091 "/* clock_times.c\n"
1092 "\\&\n"
1093 " Licensed under GNU General Public License v2 or later.\n"
1094 "*/\n"
1095 "#define _XOPEN_SOURCE 600\n"
1096 "#include E<lt>stdbool.hE<gt>\n"
1097 "#include E<lt>stdint.hE<gt>\n"
1098 "#include E<lt>stdio.hE<gt>\n"
1099 "#include E<lt>stdlib.hE<gt>\n"
1100 "#include E<lt>time.hE<gt>\n"
1101 "\\&\n"
1102 "#define SECS_IN_DAY (24 * 60 * 60)\n"
1103 "\\&\n"
1104 "static void\n"
1105 "displayClock(clockid_t clock, const char *name, bool showRes)\n"
1106 "{\n"
1107 " long days;\n"
1108 " struct timespec ts;\n"
1109 "\\&\n"
1110 " if (clock_gettime(clock, &ts) == -1) {\n"
1111 " perror(\"clock_gettime\");\n"
1112 " exit(EXIT_FAILURE);\n"
1113 " }\n"
1114 "\\&\n"
1115 " printf(\"%-15s: %10jd.%03ld (\", name,\n"
1116 " (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n"
1117 "\\&\n"
1118 " days = ts.tv_sec / SECS_IN_DAY;\n"
1119 " if (days E<gt> 0)\n"
1120 " printf(\"%ld days + \", days);\n"
1121 "\\&\n"
1122 " printf(\"%2dh %2dm %2ds\",\n"
1123 " (int) (ts.tv_sec % SECS_IN_DAY) / 3600,\n"
1124 " (int) (ts.tv_sec % 3600) / 60,\n"
1125 " (int) ts.tv_sec % 60);\n"
1126 " printf(\")\\[rs]n\");\n"
1127 "\\&\n"
1128 " if (clock_getres(clock, &ts) == -1) {\n"
1129 " perror(\"clock_getres\");\n"
1130 " exit(EXIT_FAILURE);\n"
1131 " }\n"
1132 "\\&\n"
1133 " if (showRes)\n"
1134 " printf(\" resolution: %10jd.%09ld\\[rs]n\",\n"
1135 " (intmax_t) ts.tv_sec, ts.tv_nsec);\n"
1136 "}\n"
1137 "\\&\n"
1138 "int\n"
1139 "main(int argc, char *argv[])\n"
1140 "{\n"
1141 " bool showRes = argc E<gt> 1;\n"
1142 "\\&\n"
1143 " displayClock(CLOCK_REALTIME, \"CLOCK_REALTIME\", showRes);\n"
1144 "#ifdef CLOCK_TAI\n"
1145 " displayClock(CLOCK_TAI, \"CLOCK_TAI\", showRes);\n"
1146 "#endif\n"
1147 " displayClock(CLOCK_MONOTONIC, \"CLOCK_MONOTONIC\", showRes);\n"
1148 "#ifdef CLOCK_BOOTTIME\n"
1149 " displayClock(CLOCK_BOOTTIME, \"CLOCK_BOOTTIME\", showRes);\n"
1150 "#endif\n"
1151 " exit(EXIT_SUCCESS);\n"
1152 "}\n"
1153 msgstr ""
1154
1155 #. type: TH
1156 #: fedora-44 fedora-rawhide
1157 #, no-wrap
1158 msgid "2024-11-03"
1159 msgstr ""
1160
1161 #. type: TH
1162 #: fedora-44 fedora-rawhide
1163 #, no-wrap
1164 msgid "Linux man-pages 6.13"
1165 msgstr ""
1166
1167 #. type: Plain text
1168 #: fedora-44 fedora-rawhide
1169 #, no-wrap
1170 msgid ""
1171 "/* clock_times.c\n"
1172 "\\&\n"
1173 " Licensed under GNU General Public License v2 or later.\n"
1174 "*/\n"
1175 "#define _XOPEN_SOURCE 600\n"
1176 "#include E<lt>stdbool.hE<gt>\n"
1177 "#include E<lt>stdint.hE<gt>\n"
1178 "#include E<lt>stdio.hE<gt>\n"
1179 "#include E<lt>stdlib.hE<gt>\n"
1180 "#include E<lt>sys/types.hE<gt>\n"
1181 "#include E<lt>time.hE<gt>\n"
1182 "\\&\n"
1183 "#define SECS_IN_DAY (24 * 60 * 60)\n"
1184 "\\&\n"
1185 "static void\n"
1186 "displayClock(clockid_t clock, const char *name, bool showRes)\n"
1187 "{\n"
1188 " long days;\n"
1189 " struct timespec ts;\n"
1190 "\\&\n"
1191 " if (clock_gettime(clock, &ts) == -1) {\n"
1192 " perror(\"clock_gettime\");\n"
1193 " exit(EXIT_FAILURE);\n"
1194 " }\n"
1195 "\\&\n"
1196 " printf(\"%-15s: %10jd.%03ld (\", name,\n"
1197 " (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);\n"
1198 "\\&\n"
1199 " days = ts.tv_sec / SECS_IN_DAY;\n"
1200 " if (days E<gt> 0)\n"
1201 " printf(\"%ld days + \", days);\n"
1202 "\\&\n"
1203 " printf(\"%2dh %2dm %2ds\",\n"
1204 " (int) (ts.tv_sec % SECS_IN_DAY) / 3600,\n"
1205 " (int) (ts.tv_sec % 3600) / 60,\n"
1206 " (int) ts.tv_sec % 60);\n"
1207 " printf(\")\\[rs]n\");\n"
1208 "\\&\n"
1209 " if (clock_getres(clock, &ts) == -1) {\n"
1210 " perror(\"clock_getres\");\n"
1211 " exit(EXIT_FAILURE);\n"
1212 " }\n"
1213 "\\&\n"
1214 " if (showRes)\n"
1215 " printf(\" resolution: %10jd.%09ld\\[rs]n\",\n"
1216 " (intmax_t) ts.tv_sec, ts.tv_nsec);\n"
1217 "}\n"
1218 "\\&\n"
1219 "int\n"
1220 "main(int argc, char *argv[])\n"
1221 "{\n"
1222 " bool showRes = argc E<gt> 1;\n"
1223 "\\&\n"
1224 " displayClock(CLOCK_REALTIME, \"CLOCK_REALTIME\", showRes);\n"
1225 "#ifdef CLOCK_TAI\n"
1226 " displayClock(CLOCK_TAI, \"CLOCK_TAI\", showRes);\n"
1227 "#endif\n"
1228 " displayClock(CLOCK_MONOTONIC, \"CLOCK_MONOTONIC\", showRes);\n"
1229 "#ifdef CLOCK_BOOTTIME\n"
1230 " displayClock(CLOCK_BOOTTIME, \"CLOCK_BOOTTIME\", showRes);\n"
1231 "#endif\n"
1232 " exit(EXIT_SUCCESS);\n"
1233 "}\n"
1234 msgstr ""
1235
1236 #. type: TH
1237 #: mageia-cauldron
1238 #, no-wrap
1239 msgid "2026-02-08"
1240 msgstr ""
1241
1242 #. type: TH
1243 #: mageia-cauldron
1244 #, no-wrap
1245 msgid "Linux man-pages 6.17"
1246 msgstr ""
1247
1248 #. type: TH
1249 #: opensuse-leap-16-1 opensuse-tumbleweed
1250 #, no-wrap
1251 msgid "Linux man-pages (unreleased)"
1252 msgstr ""