Debian Codegraph @

po/ru/man2/timer_create.2.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Azamat Hackimov <[email protected]>, 2014, 2016-2017.
5 # Dmitry Bolkhovskikh <[email protected]>, 2017.
6 # Yuri Kozlov <[email protected]>, 2011-2019.
7 # Иван Павлов <[email protected]>, 2017, 2019.
8 msgid ""
9 msgstr ""
10 "Project-Id-Version: manpages-l10n\n"
11 "POT-Creation-Date: 2026-06-05 06:49+0200\n"
12 "PO-Revision-Date: 2024-12-21 19:49+0300\n"
13 "Last-Translator: Yuri Kozlov <[email protected]>\n"
14 "Language-Team: Russian <[email protected]>\n"
15 "Language: ru\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
21 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
22 "X-Generator: Lokalize 2.0\n"
23
24 #. type: TH
25 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
26 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
27 #, no-wrap
28 msgid "timer_create"
29 msgstr "timer_create"
30
31 #. type: TH
32 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
33 #: opensuse-tumbleweed
34 #, no-wrap
35 msgid "2025-10-29"
36 msgstr "29 октября 2025 г."
37
38 #. type: TH
39 #: archlinux debian-unstable
40 #, fuzzy, no-wrap
41 #| msgid "Linux man-pages 6.17"
42 msgid "Linux man-pages 6.18"
43 msgstr "Справочные страницы Linux 6.17"
44
45 #. type: SH
46 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
47 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
48 #, no-wrap
49 msgid "NAME"
50 msgstr "НАИМЕНОВАНИЕ"
51
52 #. type: Plain text
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 msgid "timer_create - create a POSIX per-process timer"
56 msgstr "timer_create - создаёт таймер POSIX для определённого процесса"
57
58 #. type: SH
59 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
60 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
61 #, no-wrap
62 msgid "LIBRARY"
63 msgstr "БИБЛИОТЕКА"
64
65 #. type: Plain text
66 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
67 #: opensuse-leap-16-1 opensuse-tumbleweed
68 msgid "Real-time library (I<librt>,\\ I<-lrt>)"
69 msgstr "Библиотека реального времени (I<librt>,\\ I<-lrt>)"
70
71 #. type: SH
72 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
73 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
74 #, no-wrap
75 msgid "SYNOPSIS"
76 msgstr "СИНТАКСИС"
77
78 #. type: Plain text
79 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
80 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
81 #, no-wrap
82 msgid ""
83 "B<#include E<lt>signal.hE<gt>> /* Definition of B<SIGEV_*> constants */\n"
84 "B<#include E<lt>time.hE<gt>>\n"
85 msgstr ""
86 "B<#include E<lt>signal.hE<gt>> /* определения констант B<SIGEV_*> */\n"
87 "B<#include E<lt>time.hE<gt>>\n"
88
89 #. type: Plain text
90 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
91 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
92 #, fuzzy, no-wrap
93 #| msgid ""
94 #| "B<int timer_create(clockid_t >I<clockid>B<, struct sigevent *restrict >I<sevp>B<,>\n"
95 #| "B< timer_t *restrict >I<timerid>B<);>\n"
96 msgid ""
97 "B<int timer_create(clockid_t >I<clockid>B<,>\n"
98 "B< struct sigevent *_Nullable restrict >I<sevp>B<,>\n"
99 "B< timer_t *restrict >I<timerid>B<);>\n"
100 msgstr ""
101 "B<int timer_create(clockid_t >I<clockid>B<, struct sigevent *restrict >I<sevp>B<,>\n"
102 "B< timer_t *restrict >I<timerid>B<);>\n"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 msgid ""
108 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
109 msgstr ""
110 "Требования макроса тестирования свойств для glibc (см. "
111 "B<feature_test_macros>(7)):"
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 msgid "B<timer_create>():"
117 msgstr "B<timer_create>():"
118
119 #. type: Plain text
120 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
121 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
122 #, no-wrap
123 msgid " _POSIX_C_SOURCE E<gt>= 199309L\n"
124 msgstr " _POSIX_C_SOURCE E<gt>= 199309L\n"
125
126 #. type: SH
127 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
128 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
129 #, no-wrap
130 msgid "DESCRIPTION"
131 msgstr "ОПИСАНИЕ"
132
133 #. type: Plain text
134 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
135 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
136 msgid ""
137 "B<timer_create>() creates a new per-process interval timer. The ID of the "
138 "new timer is returned in the buffer pointed to by I<timerid>, which must be "
139 "a non-null pointer. This ID is unique within the process, until the timer "
140 "is deleted. The new timer is initially disarmed."
141 msgstr ""
142 "Вызов B<timer_create>() создаёт новый таймер для процесса. Идентификатор "
143 "нового таймера возвращается в буфере, указанном в I<timerid>, его значение "
144 "не должно быть равно null. Данный идентификатор уникален для процесса, пока "
145 "таймер не будет удалён. Новый таймер создаётся неактивным."
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 ""
151 "The I<clockid> argument specifies the clock that the new timer uses to "
152 "measure time. It can be specified as one of the following values:"
153 msgstr ""
154 "В аргументе I<clockid> задаются часы, которые используются в новом таймере "
155 "для учёта времени. Это может быть одно из следующих значений:"
156
157 #. type: TP
158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
160 #, no-wrap
161 msgid "B<CLOCK_REALTIME>"
162 msgstr "B<CLOCK_REALTIME>"
163
164 #. type: Plain text
165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
167 msgid "A settable system-wide real-time clock."
168 msgstr "Настраиваемые системные часы реального времени."
169
170 #. type: TP
171 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
172 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
173 #, no-wrap
174 msgid "B<CLOCK_MONOTONIC>"
175 msgstr "B<CLOCK_MONOTONIC>"
176
177 #. Note: the CLOCK_MONOTONIC_RAW clock added for clock_gettime()
178 #. in Linux 2.6.28 is not supported for POSIX timers -- mtk, Feb 2009
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "A nonsettable monotonically increasing clock that measures time from some "
184 "unspecified point in the past that does not change after system startup."
185 msgstr ""
186 "Ненастраиваемые, постоянно идущие вперёд часы, отсчитывающие время с "
187 "некоторой неопределённой точки в прошлом, которая не изменяется с момент "
188 "запуска системы."
189
190 #. type: TP
191 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
192 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
193 #, no-wrap
194 msgid "B<CLOCK_PROCESS_CPUTIME_ID> (since Linux 2.6.12)"
195 msgstr "B<CLOCK_PROCESS_CPUTIME_ID> (начиная с Linux 2.6.12)"
196
197 #. type: Plain text
198 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
199 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
200 msgid ""
201 "A clock that measures (user and system) CPU time consumed by (all of the "
202 "threads in) the calling process."
203 msgstr ""
204 "Часы, измеряющие время ЦП (пользовательское и системное), затраченное "
205 "вызывающим процессом (всеми его нитями)."
206
207 #. type: TP
208 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
209 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
210 #, no-wrap
211 msgid "B<CLOCK_THREAD_CPUTIME_ID> (since Linux 2.6.12)"
212 msgstr "B<CLOCK_THREAD_CPUTIME_ID> (начиная с Linux 2.6.12)"
213
214 #. The CLOCK_MONOTONIC_RAW that was added in Linux 2.6.28 can't be used
215 #. to create a timer -- mtk, Feb 2009
216 #. type: Plain text
217 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
218 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
219 msgid ""
220 "A clock that measures (user and system) CPU time consumed by the calling "
221 "thread."
222 msgstr ""
223 "Часы, измеряющие время ЦП (пользовательское и системное), затраченное "
224 "вызывающей нитью."
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_BOOTTIME> (Since Linux 2.6.39)"
231 msgstr "B<CLOCK_BOOTTIME> (начиная с Linux 2.6.39)"
232
233 #. commit 70a08cca1227dc31c784ec930099a4417a06e7d0
234 #. type: Plain text
235 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
236 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
237 msgid ""
238 "Like B<CLOCK_MONOTONIC>, this is a monotonically increasing clock. However, "
239 "whereas the B<CLOCK_MONOTONIC> clock does not measure the time while a "
240 "system is suspended, the B<CLOCK_BOOTTIME> clock does include the time "
241 "during which the system is suspended. This is useful for applications that "
242 "need to be suspend-aware. B<CLOCK_REALTIME> is not suitable for such "
243 "applications, since that clock is affected by discontinuous changes to the "
244 "system clock."
245 msgstr ""
246 "Подобно B<CLOCK_MONOTONIC>, представляет монотонно растущие часы. Однако, "
247 "если часы B<CLOCK_MONOTONIC> не отсчитывают время когда система находится в "
248 "состоянии ожидания (suspended), а часы B<CLOCK_BOOTTIME> учитывают время в "
249 "таком состоянии системы. Это полезно приложениям, которым необходимо "
250 "учитывать состояние ожидания. B<CLOCK_REALTIME> не подходят для таких "
251 "приложений, так как эти часы подвержены скачкообразным изменениям системных "
252 "часов."
253
254 #. type: TP
255 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
256 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
257 #, no-wrap
258 msgid "B<CLOCK_REALTIME_ALARM> (since Linux 3.0)"
259 msgstr "B<CLOCK_REALTIME_ALARM> (начиная с Linux 3.0)"
260
261 #. commit 9a7adcf5c6dea63d2e47e6f6d2f7a6c9f48b9337
262 #. type: Plain text
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 msgid ""
266 "This clock is like B<CLOCK_REALTIME>, but will wake the system if it is "
267 "suspended. The caller must have the B<CAP_WAKE_ALARM> capability in order "
268 "to set a timer against this clock."
269 msgstr ""
270 "Эти часы подобны B<CLOCK_REALTIME>, но разбудят систему, если она находится "
271 "с состоянии ожидания. Для установки таймера по этим часам вызывающий должен "
272 "иметь мандат B<CAP_WAKE_ALARM>."
273
274 #. type: TP
275 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
276 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
277 #, no-wrap
278 msgid "B<CLOCK_BOOTTIME_ALARM> (since Linux 3.0)"
279 msgstr "B<CLOCK_BOOTTIME_ALARM> (начиная с Linux 3.0)"
280
281 #. commit 9a7adcf5c6dea63d2e47e6f6d2f7a6c9f48b9337
282 #. type: Plain text
283 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
284 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
285 msgid ""
286 "This clock is like B<CLOCK_BOOTTIME>, but will wake the system if it is "
287 "suspended. The caller must have the B<CAP_WAKE_ALARM> capability in order "
288 "to set a timer against this clock."
289 msgstr ""
290 "Эти часы подобны B<CLOCK_BOOTTIME>, но разбудят систему, если она находится "
291 "с состоянии ожидания. Для установки таймера по этим часам вызывающий должен "
292 "иметь мандат B<CAP_WAKE_ALARM>."
293
294 #. type: TP
295 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
296 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
297 #, no-wrap
298 msgid "B<CLOCK_TAI> (since Linux 3.10)"
299 msgstr "B<CLOCK_TAI> (начиная с Linux 3.10)"
300
301 #. type: Plain text
302 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
303 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
304 msgid ""
305 "A system-wide clock derived from wall-clock time but counting leap seconds."
306 msgstr ""
307 "Системные часы, основанные на времени настенных часов, но учитывающие "
308 "дополнительные секунды."
309
310 #. type: Plain text
311 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
312 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
313 msgid "See B<clock_getres>(2) for some further details on the above clocks."
314 msgstr ""
315
316 #. type: Plain text
317 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
318 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
319 msgid ""
320 "As well as the above values, I<clockid> can be specified as the I<clockid> "
321 "returned by a call to B<clock_getcpuclockid>(3) or "
322 "B<pthread_getcpuclockid>(3)."
323 msgstr ""
324 "Помимо значений, перечисленных ранее, в I<clockid> может быть указано "
325 "I<clockid>, возвращённое вызовом B<clock_getcpuclockid>(3) или "
326 "B<pthread_getcpuclockid>(3)."
327
328 #. type: Plain text
329 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
330 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
331 #, fuzzy
332 #| msgid ""
333 #| "The I<sevp> argument points to a I<sigevent> structure that specifies how "
334 #| "the caller should be notified when the timer expires. For the definition "
335 #| "and general details of this structure, see B<sigevent>(7)."
336 msgid ""
337 "The I<sevp> argument points to a I<sigevent> structure that specifies how "
338 "the caller should be notified when the timer expires. For the definition "
339 "and general details of this structure, see B<sigevent>(3type)."
340 msgstr ""
341 "Аргумент I<sevp> указывает на структуру I<sigevent>, которая задаёт способ "
342 "уведомления вызывающего при срабатывании таймера. Определение и описание "
343 "структуры смотрите в B<sigevent>(7)."
344
345 #. type: Plain text
346 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
347 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
348 msgid "The I<sevp.sigev_notify> field can have the following values:"
349 msgstr "В поле I<sevp.sigev_notify> можно указать следующие значения:"
350
351 #. type: TP
352 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
353 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
354 #, no-wrap
355 msgid "B<SIGEV_NONE>"
356 msgstr "B<SIGEV_NONE>"
357
358 #. type: Plain text
359 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
360 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
361 msgid ""
362 "Don't asynchronously notify when the timer expires. Progress of the timer "
363 "can be monitored using B<timer_gettime>(2)."
364 msgstr ""
365 "Выполнять синхронное уведомление при срабатывании таймера. Ход таймера можно "
366 "отслеживать с помощью B<timer_gettime>(2)."
367
368 #. type: TP
369 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
370 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
371 #, no-wrap
372 msgid "B<SIGEV_SIGNAL>"
373 msgstr "B<SIGEV_SIGNAL>"
374
375 #. type: Plain text
376 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
377 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
378 #, fuzzy
379 #| msgid ""
380 #| "Upon timer expiration, generate the signal I<sigev_signo> for the "
381 #| "process. See B<sigevent>(7) for general details. The I<si_code> field "
382 #| "of the I<siginfo_t> structure will be set to B<SI_TIMER>. At any point "
383 #| "in time, at most one signal is queued to the process for a given timer; "
384 #| "see B<timer_getoverrun>(2) for more details."
385 msgid ""
386 "Upon timer expiration, generate the signal I<sigev_signo> for the process. "
387 "See B<sigevent>(3type) for general details. The I<si_code> field of the "
388 "I<siginfo_t> structure will be set to B<SI_TIMER>. At any point in time, at "
389 "most one signal is queued to the process for a given timer; see "
390 "B<timer_getoverrun>(2) for more details."
391 msgstr ""
392 "При срабатывании таймера генерировать для процесса сигнал I<sigev_signo>. "
393 "Подробности смотрите в B<sigevent>(7). Полю I<si_code> структуры "
394 "I<siginfo_t> присваивается значение B<SI_TIMER>. В любой момент времени для "
395 "таймера в очередь процесса ставится не более одного сигнала; подробности "
396 "смотрите в B<timer_getoverrun>(2)."
397
398 #. type: TP
399 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
400 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
401 #, no-wrap
402 msgid "B<SIGEV_THREAD>"
403 msgstr "B<SIGEV_THREAD>"
404
405 #. type: Plain text
406 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
407 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
408 #, fuzzy
409 #| msgid ""
410 #| "Upon timer expiration, invoke I<sigev_notify_function> as if it were the "
411 #| "start function of a new thread. See B<sigevent>(7) for details."
412 msgid ""
413 "Upon timer expiration, invoke I<sigev_notify_function> as if it were the "
414 "start function of a new thread. See B<sigevent>(3type) for details."
415 msgstr ""
416 "При срабатывании вызвать I<sigev_notify_function>, как если бы это была "
417 "начальная функция новой нити. Подробности смотрите в B<sigevent>(7)."
418
419 #. type: TP
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, no-wrap
423 msgid "B<SIGEV_THREAD_ID> (Linux-specific)"
424 msgstr "B<SIGEV_THREAD_ID> (есть только в Linux)"
425
426 #. type: Plain text
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 msgid ""
430 "As for B<SIGEV_SIGNAL>, but the signal is targeted at the thread whose ID is "
431 "given in I<sigev_notify_thread_id>, which must be a thread in the same "
432 "process as the caller. The I<sigev_notify_thread_id> field specifies a "
433 "kernel thread ID, that is, the value returned by B<clone>(2) or "
434 "B<gettid>(2). This flag is intended only for use by threading libraries."
435 msgstr ""
436 "Как для B<SIGEV_SIGNAL>, но сигнал нацелен на нить, чей ID указывается в "
437 "I<sigev_notify_thread_id>, который должен быть нитью того же процесса что и "
438 "вызывающий. В поле I<sigev_notify_thread_id> указывается ID ядерной нити, то "
439 "есть значение, возвращаемое B<clone>(2) или B<gettid>(2). Этот флаг "
440 "предназначен только для использования в библиотеках нитей."
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 msgid ""
446 "Specifying I<sevp> as NULL is equivalent to specifying a pointer to a "
447 "I<sigevent> structure in which I<sigev_notify> is B<SIGEV_SIGNAL>, "
448 "I<sigev_signo> is B<SIGALRM>, and I<sigev_value.sival_int> is the timer ID."
449 msgstr ""
450 "Указание в I<sevp> значения NULL эквивалентно указанию указателя на "
451 "структуру I<sigevent>, в которой I<sigev_notify> равно B<SIGEV_SIGNAL>, "
452 "I<sigev_signo> равно B<SIGALRM> и I<sigev_value.sival_int> равно ID таймера."
453
454 #. type: SH
455 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
456 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
457 #, no-wrap
458 msgid "RETURN VALUE"
459 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
460
461 #. type: Plain text
462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
464 msgid ""
465 "On success, B<timer_create>() returns 0, and the ID of the new timer is "
466 "placed in I<*timerid>. On failure, -1 is returned, and I<errno> is set to "
467 "indicate the error."
468 msgstr ""
469 "При успешном выполнении B<timer_create>() возвращается 0 и ID нового таймера "
470 "помещается в I<*timerid>. При ошибке возвращается -1, а I<errno> "
471 "устанавливается в соответствующее значение."
472
473 #. type: SH
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 #, no-wrap
477 msgid "ERRORS"
478 msgstr "ОШИБКИ"
479
480 #. type: TP
481 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
482 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
483 #, no-wrap
484 msgid "B<EAGAIN>"
485 msgstr "B<EAGAIN>"
486
487 #. type: Plain text
488 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
489 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
490 msgid "Temporary error during kernel allocation of timer structures."
491 msgstr "Временная ошибка, на время выделения ядром структур таймера."
492
493 #. type: TP
494 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
495 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
496 #, no-wrap
497 msgid "B<EINVAL>"
498 msgstr "B<EINVAL>"
499
500 #. type: Plain text
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 msgid ""
504 "Clock ID, I<sigev_notify>, I<sigev_signo>, or I<sigev_notify_thread_id> is "
505 "invalid."
506 msgstr ""
507 "Некорректный ID часов, I<sigev_notify>, I<sigev_signo> или "
508 "I<sigev_notify_thread_id>."
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<ENOMEM>"
515 msgstr "B<ENOMEM>"
516
517 #. glibc layer: malloc()
518 #. type: Plain text
519 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
520 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
521 msgid "Could not allocate memory."
522 msgstr "Невозможно выделить память."
523
524 #. type: TP
525 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
526 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
527 #, no-wrap
528 msgid "B<ENOTSUP>"
529 msgstr "B<ENOTSUP>"
530
531 #. type: Plain text
532 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
533 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
534 msgid "The kernel does not support creating a timer against this I<clockid>."
535 msgstr ""
536
537 #. type: TP
538 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
539 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
540 #, no-wrap
541 msgid "B<EPERM>"
542 msgstr "B<EPERM>"
543
544 #. type: Plain text
545 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
546 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
547 msgid ""
548 "I<clockid> was B<CLOCK_REALTIME_ALARM> or B<CLOCK_BOOTTIME_ALARM> but the "
549 "caller did not have the B<CAP_WAKE_ALARM> capability."
550 msgstr ""
551
552 #. type: SH
553 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
554 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
555 #, no-wrap
556 msgid "VERSIONS"
557 msgstr "ВЕРСИИ"
558
559 #. type: SS
560 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
561 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
562 #, no-wrap
563 msgid "C library/kernel differences"
564 msgstr "Отличия между библиотекой C и ядром"
565
566 #. See nptl/sysdeps/unix/sysv/linux/timer_create.c
567 #. type: Plain text
568 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
569 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
570 msgid ""
571 "Part of the implementation of the POSIX timers API is provided by glibc. In "
572 "particular:"
573 msgstr ""
574 "Частично, реализация программного интерфейса таймеров POSIX предоставляется "
575 "glibc. А именно:"
576
577 #. type: IP
578 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
579 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
580 #, no-wrap
581 msgid "\\[bu]"
582 msgstr "\\[bu]"
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 "Much of the functionality for B<SIGEV_THREAD> is implemented within glibc, "
589 "rather than the kernel. (This is necessarily so, since the thread involved "
590 "in handling the notification is one that must be managed by the C library "
591 "POSIX threads implementation.) Although the notification delivered to the "
592 "process is via a thread, internally the NPTL implementation uses a "
593 "I<sigev_notify> value of B<SIGEV_THREAD_ID> along with a real-time signal "
594 "that is reserved by the implementation (see B<nptl>(7))."
595 msgstr ""
596 "Большая часть функций для B<SIGEV_THREAD> реализована в glibc, а не в ядре "
597 "(это необходимо, так как в обработку уведомления вовлечена нить, которая "
598 "должна управляться библиотекой C, реализующей нити POSIX). Хотя уведомление "
599 "доставляется процессу через нить, внутри реализации NPTL для "
600 "B<SIGEV_THREAD_ID> используется значение I<sigev_notify> и сигнал реального "
601 "времени, который зарезервирован для реализации (смотрите B<nptl>(7))."
602
603 #. type: Plain text
604 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
605 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
606 msgid ""
607 "The implementation of the default case where I<evp> is NULL is handled "
608 "inside glibc, which invokes the underlying system call with a suitably "
609 "populated I<sigevent> structure."
610 msgstr ""
611 "Стандартная ситуация, когда I<evp> равно NULL, обрабатывается в glibc, где "
612 "вызывается нижележащий системный вызов с заполненной подходящим образом "
613 "структурой I<sigevent>."
614
615 #. See the glibc source file kernel-posix-timers.h for the structure
616 #. that glibc uses to map user-space timer IDs to kernel timer IDs
617 #. The kernel-level timer ID is exposed via siginfo.si_tid.
618 #. type: Plain text
619 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
620 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
621 msgid ""
622 "The timer IDs presented at user level are maintained by glibc, which maps "
623 "these IDs to the timer IDs employed by the kernel."
624 msgstr ""
625 "Идентификаторы таймеров, обрабатываемые на уровне пользователя, "
626 "поддерживаются glibc, которая отображает эти ID в ID таймеров, созданных "
627 "ядром."
628
629 #. type: SH
630 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
631 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
632 #, no-wrap
633 msgid "STANDARDS"
634 msgstr "СТАНДАРТЫ"
635
636 #. type: Plain text
637 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
638 #: opensuse-tumbleweed
639 msgid "POSIX.1-2024."
640 msgstr "POSIX.1-2024."
641
642 #. type: SH
643 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
644 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
645 #, no-wrap
646 msgid "HISTORY"
647 msgstr "ИСТОРИЯ"
648
649 #. type: Plain text
650 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
651 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
652 msgid "Linux 2.6. POSIX.1-2001."
653 msgstr "Linux 2.6. POSIX.1-2001."
654
655 #. glibc commit 93a78ac437ba44f493333d7e2a4b0249839ce460
656 #. type: Plain text
657 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
658 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
659 #, fuzzy
660 #| msgid ""
661 #| "The POSIX timers system calls first appeared in Linux 2.6. Prior to "
662 #| "this, glibc provided an incomplete user-space implementation "
663 #| "(B<CLOCK_REALTIME> timers only) using POSIX threads, and in glibc "
664 #| "versions before 2.17, the implementation falls back to this technique on "
665 #| "systems running pre-2.6 Linux kernels."
666 msgid ""
667 "Prior to Linux 2.6, glibc provided an incomplete user-space implementation "
668 "(B<CLOCK_REALTIME> timers only) using POSIX threads, and before glibc 2.17, "
669 "the implementation falls back to this technique on systems running kernels "
670 "older than Linux 2.6."
671 msgstr ""
672 "Системные таймерные вызовы POSIX впервые появились в Linux 2.6. До этого в "
673 "glibc была неполная реализация в пространстве пользователя (только таймеры "
674 "B<CLOCK_REALTIME>) с использованием нитей POSIX, а реализация glibc до "
675 "версии 2.17 переключается на неё в системах с ядрами до Linux 2.6."
676
677 #. type: SH
678 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
679 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
680 #, no-wrap
681 msgid "NOTES"
682 msgstr "ПРИМЕЧАНИЯ"
683
684 #. type: Plain text
685 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
686 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
687 msgid "A program may create multiple interval timers using B<timer_create>()."
688 msgstr ""
689 "С помощью B<timer_create>() программа может создавать несколько интервальных "
690 "таймеров."
691
692 #. type: Plain text
693 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
694 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
695 msgid ""
696 "Timers are not inherited by the child of a B<fork>(2), and are disarmed and "
697 "deleted during an B<execve>(2)."
698 msgstr ""
699 "Таймеры не наследуются в потомке после B<fork>(2), и выключаются и удаляются "
700 "при B<execve>(2)."
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 ""
706 "The kernel preallocates a \"queued real-time signal\" for each timer created "
707 "using B<timer_create>(). Consequently, the number of timers is limited by "
708 "the B<RLIMIT_SIGPENDING> resource limit (see B<setrlimit>(2))."
709 msgstr ""
710 "Ядро заранее выделяет «сигнал реального времени в очереди» для каждого "
711 "таймера, создаваемого B<timer_create>(). В результате, количество таймеров "
712 "ограничено ресурсом B<RLIMIT_SIGPENDING> (смотрите B<setrlimit>(2))."
713
714 #. type: Plain text
715 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
716 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
717 msgid ""
718 "The timers created by B<timer_create>() are commonly known as \"POSIX "
719 "(interval) timers\". The POSIX timers API consists of the following "
720 "interfaces:"
721 msgstr ""
722 "Таймеры, созданные B<timer_create>(), часто называют «(интервальными) "
723 "таймерами POSIX». Программный интерфейс таймеров POSIX состоит из следующих "
724 "интерфейсов:"
725
726 #. type: TP
727 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
728 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
729 #, fuzzy, no-wrap
730 #| msgid "B<timer_create>():"
731 msgid "B<timer_create>()"
732 msgstr "B<timer_create>():"
733
734 #. type: Plain text
735 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
736 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
737 #, fuzzy
738 #| msgid " /* Create the timer. */\n"
739 msgid "Create a timer."
740 msgstr " /* Создаём таймер. */\n"
741
742 #. type: TP
743 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
744 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
745 #, no-wrap
746 msgid "B<timer_settime>(2)"
747 msgstr "B<timer_settime>(2)"
748
749 #. type: Plain text
750 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
751 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
752 #, fuzzy
753 #| msgid "B<timer_settime>(2): Arm (start) or disarm (stop) a timer."
754 msgid "Arm (start) or disarm (stop) a timer."
755 msgstr ""
756 "B<timer_settime>(2): Включает (запускает) или выключает (останавливает) "
757 "таймер."
758
759 #. type: TP
760 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
761 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
762 #, no-wrap
763 msgid "B<timer_gettime>(2)"
764 msgstr "B<timer_gettime>(2)"
765
766 #. type: Plain text
767 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
768 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
769 #, fuzzy
770 #| msgid ""
771 #| "B<timer_gettime>(2): Fetch the time remaining until the next expiration "
772 #| "of a timer, along with the interval setting of the timer."
773 msgid ""
774 "Fetch the time remaining until the next expiration of a timer, along with "
775 "the interval setting of the timer."
776 msgstr ""
777 "B<timer_gettime>(2): Возвращает время, оставшееся до следующего срабатывания "
778 "таймера вместе с интервалом, заданным в таймере."
779
780 #. type: TP
781 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
782 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
783 #, no-wrap
784 msgid "B<timer_getoverrun>(2)"
785 msgstr "B<timer_getoverrun>(2)"
786
787 #. type: Plain text
788 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
789 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
790 #, fuzzy
791 #| msgid ""
792 #| "B<timer_getoverrun>(2): Return the overrun count for the last timer "
793 #| "expiration."
794 msgid "Return the overrun count for the last timer expiration."
795 msgstr ""
796 "B<timer_getoverrun>(2): Возвращает счётчик переполнения после последнего "
797 "срабатывания таймера."
798
799 #. type: TP
800 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
801 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
802 #, no-wrap
803 msgid "B<timer_delete>(2)"
804 msgstr "B<timer_delete>(2)"
805
806 #. type: Plain text
807 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
808 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
809 #, fuzzy
810 #| msgid "B<timer_delete>(2): Disarm and delete a timer."
811 msgid "Disarm and delete a timer."
812 msgstr "B<timer_delete>(2): Выключает и удаляет таймер."
813
814 #. type: Plain text
815 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
816 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
817 msgid ""
818 "Since Linux 3.10, the I</proc/>pidI</timers> file can be used to list the "
819 "POSIX timers for the process with PID I<pid>. See B<proc>(5) for further "
820 "information."
821 msgstr ""
822 "Начиная с Linux 3.10, файл I</proc/>pidI</timers> можно использовать для "
823 "просмотра списка таймеров POSIX для процесса с PID равным I<pid>. "
824 "Подробности смотрите в B<proc>(5)."
825
826 #. baa73d9e478ff32d62f3f9422822b59dd9a95a21
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 "Since Linux 4.10, support for POSIX timers is a configurable option that is "
832 "enabled by default. Kernel support can be disabled via the "
833 "B<CONFIG_POSIX_TIMERS> option."
834 msgstr ""
835 "Начиная с Linux 4.10, поддержка таймеров POSIX теперь необязательна и "
836 "включена по умолчанию. Поддержку в ядре можно выключить через параметр "
837 "B<CONFIG_POSIX_TIMERS>."
838
839 #. type: SH
840 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
841 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
842 #, no-wrap
843 msgid "EXAMPLES"
844 msgstr "ПРИМЕРЫ"
845
846 #. type: Plain text
847 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
848 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
849 msgid ""
850 "The program below takes two arguments: a sleep period in seconds, and a "
851 "timer frequency in nanoseconds. The program establishes a handler for the "
852 "signal it uses for the timer, blocks that signal, creates and arms a timer "
853 "that expires with the given frequency, sleeps for the specified number of "
854 "seconds, and then unblocks the timer signal. Assuming that the timer "
855 "expired at least once while the program slept, the signal handler will be "
856 "invoked, and the handler displays some information about the timer "
857 "notification. The program terminates after one invocation of the signal "
858 "handler."
859 msgstr ""
860 "Программа ниже обрабатывает два аргумента: интервал сна в секундах и частоту "
861 "таймера в наносекундах. Программа устанавливает обработчик сигнала для "
862 "таймера, блокирует этот сигнал, создаёт и включает таймер, который "
863 "срабатывает с заданной частотой, засыпает на указанное количество секунд, а "
864 "после разблокирует сигнал таймера. Предполагая, что таймер сработает не "
865 "менее одного раза пока программа спит, обработчик сигнала будет вызван и "
866 "покажет некоторую информацию об уведомлении таймера. Программа завершается "
867 "после одного вызова обработчика сигнала."
868
869 #. type: Plain text
870 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
871 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
872 msgid ""
873 "In the following example run, the program sleeps for 1 second, after "
874 "creating a timer that has a frequency of 100 nanoseconds. By the time the "
875 "signal is unblocked and delivered, there have been around ten million "
876 "overruns."
877 msgstr ""
878 "В следующем примере программа спит 1 секунду после создания таймера, который "
879 "работает с частотой 100 наносекунд. За время разблокировки и доставки "
880 "сигнала, произошло около 10 миллионов переполнений."
881
882 #. type: Plain text
883 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
884 #: opensuse-tumbleweed
885 #, fuzzy, no-wrap
886 #| msgid ""
887 #| "$ B<./a.out 1 100>\n"
888 #| "Establishing handler for signal 34\n"
889 #| "Blocking signal 34\n"
890 #| "timer ID is 0x804c008\n"
891 #| "Sleeping for 1 seconds\n"
892 #| "Unblocking signal 34\n"
893 #| "Caught signal 34\n"
894 #| " sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008\n"
895 #| " overrun count = 10004886\n"
896 msgid ""
897 "$B< ./a.out 1 100>;\n"
898 "Establishing handler for signal 34\n"
899 "Blocking signal 34\n"
900 "timer ID is 0x804c008\n"
901 "Sleeping for 1 seconds\n"
902 "Unblocking signal 34\n"
903 "Caught signal 34\n"
904 " sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008\n"
905 " overrun count = 10004886\n"
906 msgstr ""
907 "./$ B<./a.out 1 100>\n"
908 "Устанавливается обработчик сигнала 34\n"
909 "Блокируется сигнал 34\n"
910 "ID таймера — 0x804c008\n"
911 "Спим 1 секунду\n"
912 "Разблокируется сигнал 34\n"
913 "Пойман сигнал 34\n"
914 " sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008\n"
915 " счётчик переполнения = 10004886\n"
916
917 #. type: SS
918 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
919 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
920 #, no-wrap
921 msgid "Program source"
922 msgstr "Исходный код программы"
923
924 #. type: Plain text
925 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
926 #: opensuse-tumbleweed
927 #, no-wrap
928 msgid ""
929 "#include E<lt>err.hE<gt>\n"
930 "#include E<lt>signal.hE<gt>\n"
931 "#include E<lt>stdint.hE<gt>\n"
932 "#include E<lt>stdio.hE<gt>\n"
933 "#include E<lt>stdlib.hE<gt>\n"
934 "#include E<lt>time.hE<gt>\n"
935 "#include E<lt>unistd.hE<gt>\n"
936 "\\&\n"
937 "#define CLOCKID CLOCK_REALTIME\n"
938 "#define SIG SIGRTMIN\n"
939 "\\&\n"
940 "static void\n"
941 "print_siginfo(siginfo_t *si)\n"
942 "{\n"
943 " int or;\n"
944 " timer_t *tidp;\n"
945 "\\&\n"
946 " tidp = si-E<gt>si_value.sival_ptr;\n"
947 "\\&\n"
948 " printf(\" sival_ptr = %p; \", si-E<gt>si_value.sival_ptr);\n"
949 " printf(\" *sival_ptr = %#jx\\[rs]n\", (uintmax_t) *tidp);\n"
950 "\\&\n"
951 " or = timer_getoverrun(*tidp);\n"
952 " if (or == -1)\n"
953 " err(EXIT_FAILURE, \"timer_getoverrun\");\n"
954 "\\&\n"
955 " printf(\" overrun count = %d\\[rs]n\", or);\n"
956 "}\n"
957 "\\&\n"
958 "static void\n"
959 "handler(int sig, siginfo_t *si, void *uc)\n"
960 "{\n"
961 " /* Note: calling printf() from a signal handler is not safe\n"
962 " (and should not be done in production programs), since\n"
963 " printf() is not async-signal-safe; see signal-safety(7).\n"
964 " Nevertheless, we use printf() here as a simple way of\n"
965 " showing that the handler was called. */\n"
966 "\\&\n"
967 " printf(\"Caught signal %d\\[rs]n\", sig);\n"
968 " print_siginfo(si);\n"
969 " signal(sig, SIG_IGN);\n"
970 "}\n"
971 "\\&\n"
972 "int\n"
973 "main(int argc, char *argv[])\n"
974 "{\n"
975 " timer_t timerid;\n"
976 " sigset_t mask;\n"
977 " long long freq_nanosecs;\n"
978 " struct sigevent sev;\n"
979 " struct sigaction sa;\n"
980 " struct itimerspec its;\n"
981 "\\&\n"
982 " if (argc != 3) {\n"
983 " fprintf(stderr, \"Usage: %s E<lt>sleep-secsE<gt> E<lt>freq-nanosecsE<gt>\\[rs]n\",\n"
984 " argv[0]);\n"
985 " exit(EXIT_FAILURE);\n"
986 " }\n"
987 "\\&\n"
988 " /* Establish handler for timer signal. */\n"
989 "\\&\n"
990 " printf(\"Establishing handler for signal %d\\[rs]n\", SIG);\n"
991 " sa.sa_flags = SA_SIGINFO;\n"
992 " sa.sa_sigaction = handler;\n"
993 " sigemptyset(&sa.sa_mask);\n"
994 " if (sigaction(SIG, &sa, NULL) == -1)\n"
995 " err(EXIT_FAILURE, \"sigaction\");\n"
996 "\\&\n"
997 " /* Block timer signal temporarily. */\n"
998 "\\&\n"
999 " printf(\"Blocking signal %d\\[rs]n\", SIG);\n"
1000 " sigemptyset(&mask);\n"
1001 " sigaddset(&mask, SIG);\n"
1002 " if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1)\n"
1003 " err(EXIT_FAILURE, \"sigprocmask\");\n"
1004 "\\&\n"
1005 " /* Create the timer. */\n"
1006 "\\&\n"
1007 " sev.sigev_notify = SIGEV_SIGNAL;\n"
1008 " sev.sigev_signo = SIG;\n"
1009 " sev.sigev_value.sival_ptr = &timerid;\n"
1010 " if (timer_create(CLOCKID, &sev, &timerid) == -1)\n"
1011 " err(EXIT_FAILURE, \"timer_create\");\n"
1012 "\\&\n"
1013 " printf(\"timer ID is %#jx\\[rs]n\", (uintmax_t) timerid);\n"
1014 "\\&\n"
1015 " /* Start the timer. */\n"
1016 "\\&\n"
1017 " freq_nanosecs = atoll(argv[2]);\n"
1018 " its.it_value.tv_sec = freq_nanosecs / 1000000000;\n"
1019 " its.it_value.tv_nsec = freq_nanosecs % 1000000000;\n"
1020 " its.it_interval.tv_sec = its.it_value.tv_sec;\n"
1021 " its.it_interval.tv_nsec = its.it_value.tv_nsec;\n"
1022 "\\&\n"
1023 " if (timer_settime(timerid, 0, &its, NULL) == -1)\n"
1024 " err(EXIT_FAILURE, \"timer_settime\");\n"
1025 "\\&\n"
1026 " /* Sleep for a while; meanwhile, the timer may expire\n"
1027 " multiple times. */\n"
1028 "\\&\n"
1029 " printf(\"Sleeping for %d seconds\\[rs]n\", atoi(argv[1]));\n"
1030 " sleep(atoi(argv[1]));\n"
1031 "\\&\n"
1032 " /* Unlock the timer signal, so that timer notification\n"
1033 " can be delivered. */\n"
1034 "\\&\n"
1035 " printf(\"Unblocking signal %d\\[rs]n\", SIG);\n"
1036 " if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1)\n"
1037 " err(EXIT_FAILURE, \"sigprocmask\");\n"
1038 "\\&\n"
1039 " exit(EXIT_SUCCESS);\n"
1040 "}\n"
1041 msgstr ""
1042
1043 #. SRC END
1044 #. type: SH
1045 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1046 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1047 #, no-wrap
1048 msgid "SEE ALSO"
1049 msgstr "СМОТРИТЕ ТАКЖЕ"
1050
1051 #. type: Plain text
1052 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1053 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1054 #, fuzzy
1055 #| msgid ""
1056 #| "B<clock_gettime>(2), B<setitimer>(2), B<timer_delete>(2), "
1057 #| "B<timer_getoverrun>(2), B<timer_settime>(2), B<timerfd_create>(2), "
1058 #| "B<clock_getcpuclockid>(3), B<pthread_getcpuclockid>(3), B<pthreads>(7), "
1059 #| "B<sigevent>(7), B<signal>(7), B<time>(7)"
1060 msgid ""
1061 "B<clock_gettime>(2), B<setitimer>(2), B<timer_delete>(2), "
1062 "B<timer_getoverrun>(2), B<timer_settime>(2), B<timerfd_create>(2), "
1063 "B<clock_getcpuclockid>(3), B<pthread_getcpuclockid>(3), B<pthreads>(7), "
1064 "B<sigevent>(3type), B<signal>(7), B<time>(7)"
1065 msgstr ""
1066 "B<clock_gettime>(2), B<setitimer>(2), B<timer_delete>(2), "
1067 "B<timer_getoverrun>(2), B<timer_settime>(2), B<timerfd_create>(2), "
1068 "B<clock_getcpuclockid>(3), B<pthread_getcpuclockid>(3), B<pthreads>(7), "
1069 "B<sigevent>(7), B<signal>(7), B<time>(7)"
1070
1071 #. type: TH
1072 #: debian-trixie
1073 #, no-wrap
1074 msgid "2024-06-15"
1075 msgstr "15 июня 2024 г."
1076
1077 #. type: TH
1078 #: debian-trixie
1079 #, no-wrap
1080 msgid "Linux man-pages 6.9.1"
1081 msgstr "Страницы руководства Linux 6.9.1"
1082
1083 #. type: Plain text
1084 #: debian-trixie
1085 msgid "Real-time library (I<librt>, I<-lrt>)"
1086 msgstr "Библиотека реального времени (I<librt>, I<-lrt>)"
1087
1088 #. type: Plain text
1089 #: debian-trixie fedora-44 fedora-rawhide
1090 msgid "POSIX.1-2008."
1091 msgstr "POSIX.1-2008."
1092
1093 #. type: Plain text
1094 #: debian-trixie fedora-44 fedora-rawhide
1095 #, no-wrap
1096 msgid ""
1097 "$ B<./a.out 1 100>\n"
1098 "Establishing handler for signal 34\n"
1099 "Blocking signal 34\n"
1100 "timer ID is 0x804c008\n"
1101 "Sleeping for 1 seconds\n"
1102 "Unblocking signal 34\n"
1103 "Caught signal 34\n"
1104 " sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008\n"
1105 " overrun count = 10004886\n"
1106 msgstr ""
1107 "./$ B<./a.out 1 100>\n"
1108 "Устанавливается обработчик сигнала 34\n"
1109 "Блокируется сигнал 34\n"
1110 "ID таймера — 0x804c008\n"
1111 "Спим 1 секунду\n"
1112 "Разблокируется сигнал 34\n"
1113 "Пойман сигнал 34\n"
1114 " sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008\n"
1115 " счётчик переполнения = 10004886\n"
1116
1117 #. type: Plain text
1118 #: debian-trixie fedora-44 fedora-rawhide
1119 #, no-wrap
1120 msgid ""
1121 "#include E<lt>signal.hE<gt>\n"
1122 "#include E<lt>stdint.hE<gt>\n"
1123 "#include E<lt>stdio.hE<gt>\n"
1124 "#include E<lt>stdlib.hE<gt>\n"
1125 "#include E<lt>time.hE<gt>\n"
1126 "#include E<lt>unistd.hE<gt>\n"
1127 "\\&\n"
1128 "#define CLOCKID CLOCK_REALTIME\n"
1129 "#define SIG SIGRTMIN\n"
1130 "\\&\n"
1131 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1132 " } while (0)\n"
1133 "\\&\n"
1134 "static void\n"
1135 "print_siginfo(siginfo_t *si)\n"
1136 "{\n"
1137 " int or;\n"
1138 " timer_t *tidp;\n"
1139 "\\&\n"
1140 " tidp = si-E<gt>si_value.sival_ptr;\n"
1141 "\\&\n"
1142 " printf(\" sival_ptr = %p; \", si-E<gt>si_value.sival_ptr);\n"
1143 " printf(\" *sival_ptr = %#jx\\[rs]n\", (uintmax_t) *tidp);\n"
1144 "\\&\n"
1145 " or = timer_getoverrun(*tidp);\n"
1146 " if (or == -1)\n"
1147 " errExit(\"timer_getoverrun\");\n"
1148 " else\n"
1149 " printf(\" overrun count = %d\\[rs]n\", or);\n"
1150 "}\n"
1151 "\\&\n"
1152 "static void\n"
1153 "handler(int sig, siginfo_t *si, void *uc)\n"
1154 "{\n"
1155 " /* Note: calling printf() from a signal handler is not safe\n"
1156 " (and should not be done in production programs), since\n"
1157 " printf() is not async-signal-safe; see signal-safety(7).\n"
1158 " Nevertheless, we use printf() here as a simple way of\n"
1159 " showing that the handler was called. */\n"
1160 "\\&\n"
1161 " printf(\"Caught signal %d\\[rs]n\", sig);\n"
1162 " print_siginfo(si);\n"
1163 " signal(sig, SIG_IGN);\n"
1164 "}\n"
1165 "\\&\n"
1166 "int\n"
1167 "main(int argc, char *argv[])\n"
1168 "{\n"
1169 " timer_t timerid;\n"
1170 " sigset_t mask;\n"
1171 " long long freq_nanosecs;\n"
1172 " struct sigevent sev;\n"
1173 " struct sigaction sa;\n"
1174 " struct itimerspec its;\n"
1175 "\\&\n"
1176 " if (argc != 3) {\n"
1177 " fprintf(stderr, \"Usage: %s E<lt>sleep-secsE<gt> E<lt>freq-nanosecsE<gt>\\[rs]n\",\n"
1178 " argv[0]);\n"
1179 " exit(EXIT_FAILURE);\n"
1180 " }\n"
1181 "\\&\n"
1182 " /* Establish handler for timer signal. */\n"
1183 "\\&\n"
1184 " printf(\"Establishing handler for signal %d\\[rs]n\", SIG);\n"
1185 " sa.sa_flags = SA_SIGINFO;\n"
1186 " sa.sa_sigaction = handler;\n"
1187 " sigemptyset(&sa.sa_mask);\n"
1188 " if (sigaction(SIG, &sa, NULL) == -1)\n"
1189 " errExit(\"sigaction\");\n"
1190 "\\&\n"
1191 " /* Block timer signal temporarily. */\n"
1192 "\\&\n"
1193 " printf(\"Blocking signal %d\\[rs]n\", SIG);\n"
1194 " sigemptyset(&mask);\n"
1195 " sigaddset(&mask, SIG);\n"
1196 " if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1)\n"
1197 " errExit(\"sigprocmask\");\n"
1198 "\\&\n"
1199 " /* Create the timer. */\n"
1200 "\\&\n"
1201 " sev.sigev_notify = SIGEV_SIGNAL;\n"
1202 " sev.sigev_signo = SIG;\n"
1203 " sev.sigev_value.sival_ptr = &timerid;\n"
1204 " if (timer_create(CLOCKID, &sev, &timerid) == -1)\n"
1205 " errExit(\"timer_create\");\n"
1206 "\\&\n"
1207 " printf(\"timer ID is %#jx\\[rs]n\", (uintmax_t) timerid);\n"
1208 "\\&\n"
1209 " /* Start the timer. */\n"
1210 "\\&\n"
1211 " freq_nanosecs = atoll(argv[2]);\n"
1212 " its.it_value.tv_sec = freq_nanosecs / 1000000000;\n"
1213 " its.it_value.tv_nsec = freq_nanosecs % 1000000000;\n"
1214 " its.it_interval.tv_sec = its.it_value.tv_sec;\n"
1215 " its.it_interval.tv_nsec = its.it_value.tv_nsec;\n"
1216 "\\&\n"
1217 " if (timer_settime(timerid, 0, &its, NULL) == -1)\n"
1218 " errExit(\"timer_settime\");\n"
1219 "\\&\n"
1220 " /* Sleep for a while; meanwhile, the timer may expire\n"
1221 " multiple times. */\n"
1222 "\\&\n"
1223 " printf(\"Sleeping for %d seconds\\[rs]n\", atoi(argv[1]));\n"
1224 " sleep(atoi(argv[1]));\n"
1225 "\\&\n"
1226 " /* Unlock the timer signal, so that timer notification\n"
1227 " can be delivered. */\n"
1228 "\\&\n"
1229 " printf(\"Unblocking signal %d\\[rs]n\", SIG);\n"
1230 " if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1)\n"
1231 " errExit(\"sigprocmask\");\n"
1232 "\\&\n"
1233 " exit(EXIT_SUCCESS);\n"
1234 "}\n"
1235 msgstr ""
1236
1237 #. type: TH
1238 #: fedora-44 fedora-rawhide
1239 #, no-wrap
1240 msgid "2024-07-23"
1241 msgstr "23 июля 2024 г."
1242
1243 #. type: TH
1244 #: fedora-44 fedora-rawhide
1245 #, no-wrap
1246 msgid "Linux man-pages 6.13"
1247 msgstr "Страницы руководства Linux 6.13"
1248
1249 #. type: TH
1250 #: mageia-cauldron
1251 #, no-wrap
1252 msgid "Linux man-pages 6.17"
1253 msgstr "Страницы руководства Linux 6.17"
1254
1255 #. type: TH
1256 #: opensuse-leap-16-1 opensuse-tumbleweed
1257 #, no-wrap
1258 msgid "Linux man-pages (unreleased)"
1259 msgstr "Страницы руководства Linux (не выпущены)"