Debian Codegraph @

po/ru/man2/select.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 # Alexander Golubev <[email protected]>, 2018.
5 # Azamat Hackimov <[email protected]>, 2011, 2014-2016.
6 # Hotellook, 2014.
7 # Nikita <[email protected]>, 2014.
8 # Spiros Georgaras <[email protected]>, 2016.
9 # Vladislav <[email protected]>, 2015.
10 # Yuri Kozlov <[email protected]>, 2011-2019.
11 # Иван Павлов <[email protected]>, 2017.
12 msgid ""
13 msgstr ""
14 "Project-Id-Version: manpages-l10n\n"
15 "POT-Creation-Date: 2026-06-05 06:42+0200\n"
16 "PO-Revision-Date: 2024-12-21 19:49+0300\n"
17 "Last-Translator: Yuri Kozlov <[email protected]>\n"
18 "Language-Team: Russian <[email protected]>\n"
19 "Language: ru\n"
20 "MIME-Version: 1.0\n"
21 "Content-Type: text/plain; charset=UTF-8\n"
22 "Content-Transfer-Encoding: 8bit\n"
23 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
24 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
25 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
26 "X-Generator: Lokalize 2.0\n"
27
28 #. type: TH
29 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
30 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
31 #, no-wrap
32 msgid "select"
33 msgstr "select"
34
35 #. type: TH
36 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
37 #: opensuse-tumbleweed
38 #, no-wrap
39 msgid "2026-02-08"
40 msgstr "8 февраля 2026 г."
41
42 #. type: TH
43 #: archlinux debian-unstable
44 #, fuzzy, no-wrap
45 #| msgid "Linux man-pages 6.17"
46 msgid "Linux man-pages 6.18"
47 msgstr "Справочные страницы Linux 6.17"
48
49 #. type: SH
50 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
51 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
52 #, no-wrap
53 msgid "NAME"
54 msgstr "НАИМЕНОВАНИЕ"
55
56 #. type: Plain text
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 msgid ""
60 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO, fd_set - synchronous I/O "
61 "multiplexing"
62 msgstr ""
63 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO, fd_set - многопоточный "
64 "синхронный ввод-вывод"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "LIBRARY"
71 msgstr "БИБЛИОТЕКА"
72
73 #. type: Plain text
74 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
75 #: opensuse-leap-16-1 opensuse-tumbleweed
76 msgid "Standard C library (I<libc>,\\ I<-lc>)"
77 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
78
79 #. type: SH
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "SYNOPSIS"
84 msgstr "СИНТАКСИС"
85
86 #. type: Plain text
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, no-wrap
90 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
91 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
92
93 #. type: Plain text
94 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
95 #: opensuse-tumbleweed
96 #, fuzzy, no-wrap
97 #| msgid "B<typedef> /* ... */ B<fd_set;>\n"
98 msgid "B<typedef> /* .\\|.\\|.\\& */ B<fd_set;>\n"
99 msgstr "B<typedef> /* ... */ B<fd_set;>\n"
100
101 #. type: Plain text
102 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
103 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
104 #, fuzzy, no-wrap
105 #| msgid ""
106 #| "B<int select(int >I<nfds>B<, fd_set *restrict >I<readfds>B<,>\n"
107 #| "B< fd_set *restrict >I<writefds>B<, fd_set *restrict >I<exceptfds>B<,>\n"
108 #| "B< struct timeval *restrict >I<timeout>B<);>\n"
109 msgid ""
110 "B<int select(int >I<nfds>B<, fd_set *_Nullable restrict >I<readfds>B<,>\n"
111 "B< fd_set *_Nullable restrict >I<writefds>B<,>\n"
112 "B< fd_set *_Nullable restrict >I<exceptfds>B<,>\n"
113 "B< struct timeval *_Nullable restrict >I<timeout>B<);>\n"
114 msgstr ""
115 "B<int select(int >I<nfds>B<, fd_set *restrict >I<readfds>B<,>\n"
116 "B< fd_set *restrict >I<writefds>B<, fd_set *restrict >I<exceptfds>B<,>\n"
117 "B< struct timeval *restrict >I<timeout>B<);>\n"
118
119 #. type: Plain text
120 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
121 #: opensuse-tumbleweed
122 #, fuzzy, no-wrap
123 #| msgid ""
124 #| "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
125 #| "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
126 #| "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
127 #| "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
128 msgid ""
129 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
130 "B<int FD_ISSET(int >I<fd>B<, const fd_set *>I<set>B<);>\n"
131 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
132 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
133 msgstr ""
134 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
135 "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
136 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
137 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
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 #, fuzzy, no-wrap
143 #| msgid ""
144 #| "B<int pselect(int >I<nfds>B<, fd_set *restrict >I<readfds>B<,>\n"
145 #| "B< fd_set *restrict >I<writefds>B<, fd_set *restrict >I<exceptfds>B<,>\n"
146 #| "B< const struct timespec *restrict >I<timeout>B<,>\n"
147 #| "B< const sigset_t *restrict >I<sigmask>B<);>\n"
148 msgid ""
149 "B<int pselect(int >I<nfds>B<, fd_set *_Nullable restrict >I<readfds>B<,>\n"
150 "B< fd_set *_Nullable restrict >I<writefds>B<,>\n"
151 "B< fd_set *_Nullable restrict >I<exceptfds>B<,>\n"
152 "B< const struct timespec *_Nullable restrict >I<timeout>B<,>\n"
153 "B< const sigset_t *_Nullable restrict >I<sigmask>B<);>\n"
154 msgstr ""
155 "B<int pselect(int >I<nfds>B<, fd_set *restrict >I<readfds>B<,>\n"
156 "B< fd_set *restrict >I<writefds>B<, fd_set *restrict >I<exceptfds>B<,>\n"
157 "B< const struct timespec *restrict >I<timeout>B<,>\n"
158 "B< const sigset_t *restrict >I<sigmask>B<);>\n"
159
160 #. type: Plain text
161 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
162 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
163 msgid ""
164 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
165 msgstr ""
166 "Требования макроса тестирования свойств для glibc (см. "
167 "B<feature_test_macros>(7)):"
168
169 #. type: Plain text
170 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
171 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
172 msgid "B<pselect>():"
173 msgstr "B<pselect>():"
174
175 #. type: Plain text
176 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
177 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
178 #, no-wrap
179 msgid " _POSIX_C_SOURCE E<gt>= 200112L\n"
180 msgstr " _POSIX_C_SOURCE E<gt>= 200112L\n"
181
182 #. type: SH
183 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
184 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
185 #, no-wrap
186 msgid "DESCRIPTION"
187 msgstr "ОПИСАНИЕ"
188
189 #. type: Plain text
190 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
191 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
192 msgid ""
193 "B<WARNING>: B<select>() can monitor only file descriptors numbers that are "
194 "less than B<FD_SETSIZE> (1024)\\[em]an unreasonably low limit for many "
195 "modern applications\\[em]and this limitation will not change. All modern "
196 "applications should instead use B<poll>(2) or B<epoll>(7), which do not "
197 "suffer this limitation."
198 msgstr ""
199
200 #. type: Plain text
201 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
202 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
203 #, fuzzy
204 #| msgid ""
205 #| "B<select>() and B<pselect>() allow a program to monitor multiple file "
206 #| "descriptors, waiting until one or more of the file descriptors become "
207 #| "\"ready\" for some class of I/O operation (e.g., input possible). A file "
208 #| "descriptor is considered ready if it is possible to perform a "
209 #| "corresponding I/O operation (e.g., B<read>(2), or a sufficiently small "
210 #| "B<write>(2)) without blocking."
211 msgid ""
212 "B<select>() allows a program to monitor multiple file descriptors, waiting "
213 "until one or more of the file descriptors become \"ready\" for some class of "
214 "I/O operation (e.g., input possible). A file descriptor is considered ready "
215 "if it is possible to perform a corresponding I/O operation (e.g., "
216 "B<read>(2), or a sufficiently small B<write>(2)) without blocking."
217 msgstr ""
218 "Вызовы B<select>() и B<pselect>() позволяют программам отслеживать изменения "
219 "нескольких файловых дескрипторов ожидая, когда один или более файловых "
220 "дескрипторов станут «готовы» для операции ввода-вывода определённого типа "
221 "(например, ввода). Файловый дескриптор считается готовым, если к нему "
222 "возможно применить соответствующую операцию ввода-вывода (например, "
223 "B<read>(2) или очень маленький B<write>(2)) без блокировки."
224
225 #. type: SS
226 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
227 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
228 #, no-wrap
229 msgid "fd_set"
230 msgstr "fd_set"
231
232 #. type: Plain text
233 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
234 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
235 msgid ""
236 "A structure type that can represent a set of file descriptors. According to "
237 "POSIX, the maximum number of file descriptors in an I<fd_set> structure is "
238 "the value of the macro B<FD_SETSIZE>."
239 msgstr ""
240
241 #. type: SS
242 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
243 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
244 #, fuzzy, no-wrap
245 #| msgid "By file descriptor"
246 msgid "File descriptor sets"
247 msgstr "По файловому дескриптору"
248
249 #. type: Plain text
250 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
251 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
252 msgid ""
253 "The principal arguments of B<select>() are three \"sets\" of file "
254 "descriptors (declared with the type I<fd_set>), which allow the caller to "
255 "wait for three classes of events on the specified set of file descriptors. "
256 "Each of the I<fd_set> arguments may be specified as NULL if no file "
257 "descriptors are to be watched for the corresponding class of events."
258 msgstr ""
259
260 #. type: Plain text
261 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
262 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
263 #, fuzzy
264 #| msgid ""
265 #| "On exit, each of the file descriptor sets is modified in place to "
266 #| "indicate which file descriptors actually changed status. (Thus, if using "
267 #| "B<select>() within a loop, the sets must be reinitialized before each "
268 #| "call.)"
269 msgid ""
270 "B<Note well>: Upon return, each of the file descriptor sets is modified in "
271 "place to indicate which file descriptors are currently \"ready\". Thus, if "
272 "using B<select>() within a loop, the sets I<must be reinitialized> before "
273 "each call."
274 msgstr ""
275 "При возврате из вызова наборы файловых дескрипторов изменяются, показывая "
276 "какие файловые дескрипторы фактически изменили состояние (то есть, если "
277 "используется B<select>() в цикле, то наборы должны переинициализироваться "
278 "перед каждым вызовом)."
279
280 #. type: Plain text
281 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
282 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
283 msgid ""
284 "The contents of a file descriptor set can be manipulated using the following "
285 "macros:"
286 msgstr ""
287
288 #. type: TP
289 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
290 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
291 #, no-wrap
292 msgid "B<FD_ZERO>()"
293 msgstr "B<FD_ZERO>()"
294
295 #. type: Plain text
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 msgid ""
299 "This macro clears (removes all file descriptors from) I<set>. It should be "
300 "employed as the first step in initializing a file descriptor set."
301 msgstr ""
302
303 #. type: TP
304 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
305 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
306 #, no-wrap
307 msgid "B<FD_SET>()"
308 msgstr "B<FD_SET>()"
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 ""
314 "This macro adds the file descriptor I<fd> to I<set>. Adding a file "
315 "descriptor that is already present in the set is a no-op, and does not "
316 "produce an error."
317 msgstr ""
318
319 #. type: TP
320 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
321 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
322 #, no-wrap
323 msgid "B<FD_CLR>()"
324 msgstr "B<FD_CLR>()"
325
326 #. type: Plain text
327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
329 msgid ""
330 "This macro removes the file descriptor I<fd> from I<set>. Removing a file "
331 "descriptor that is not present in the set is a no-op, and does not produce "
332 "an error."
333 msgstr ""
334
335 #. type: TP
336 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
337 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
338 #, no-wrap
339 msgid "B<FD_ISSET>()"
340 msgstr "B<FD_ISSET>()"
341
342 #. type: Plain text
343 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
344 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
345 msgid ""
346 "B<select>() modifies the contents of the sets according to the rules "
347 "described below. After calling B<select>(), the B<FD_ISSET>() macro can be "
348 "used to test if a file descriptor is still present in a set. B<FD_ISSET>() "
349 "returns nonzero if the file descriptor I<fd> is present in I<set>, and zero "
350 "if it is not."
351 msgstr ""
352
353 #. type: SS
354 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
355 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
356 #, no-wrap
357 msgid "Arguments"
358 msgstr "Аргументы"
359
360 #. type: Plain text
361 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
362 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
363 #, fuzzy
364 #| msgid "The elements of this structure are as follows:"
365 msgid "The arguments of B<select>() are as follows:"
366 msgstr "Элементы этой структуры имеют следующее назначение:"
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 "I<readfds>"
373 msgstr "I<readfds>"
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 msgid ""
379 "The file descriptors in this set are watched to see if they are ready for "
380 "reading. A file descriptor is ready for reading if a read operation will "
381 "not block; in particular, a file descriptor is also ready on end-of-file."
382 msgstr ""
383
384 #. type: Plain text
385 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
386 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
387 #, fuzzy
388 #| msgid ""
389 #| "This set is watched to see if data is available for reading from any of "
390 #| "its file descriptors. After B<select>() has returned, I<readfds> will "
391 #| "be cleared of all file descriptors except for those that are immediately "
392 #| "available for reading."
393 msgid ""
394 "After B<select>() has returned, I<readfds> will be cleared of all file "
395 "descriptors except for those that are ready for reading."
396 msgstr ""
397 "Этот набор служит для слежения за появлением данных, доступных для чтения из "
398 "любого файлового дескриптора. После возврата из B<select>() в I<readfds> "
399 "остаются только те дескрипторы файлов, из которых возможно немедленное "
400 "чтение."
401
402 #. type: TP
403 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
404 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
405 #, no-wrap
406 msgid "I<writefds>"
407 msgstr "I<writefds>"
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 ""
413 "The file descriptors in this set are watched to see if they are ready for "
414 "writing. A file descriptor is ready for writing if a write operation will "
415 "not block. However, even if a file descriptor indicates as writable, a "
416 "large write may still block."
417 msgstr ""
418
419 #. type: Plain text
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, fuzzy
423 #| msgid ""
424 #| "This set is watched to see if there is space to write data to any of its "
425 #| "file descriptors. After B<select>() has returned, I<writefds> will be "
426 #| "cleared of all file descriptors except for those that are immediately "
427 #| "available for writing."
428 msgid ""
429 "After B<select>() has returned, I<writefds> will be cleared of all file "
430 "descriptors except for those that are ready for writing."
431 msgstr ""
432 "Этот набор служит для слежения за появлением места для записи данных в любой "
433 "из файловых дескрипторов набора. После возврата из B<select>() в I<writefds> "
434 "остаются только те файловые дескрипторы, в которые возможна немедленная "
435 "запись."
436
437 #. type: TP
438 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
439 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
440 #, no-wrap
441 msgid "I<exceptfds>"
442 msgstr "I<exceptfds>"
443
444 #. type: Plain text
445 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
446 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
447 msgid ""
448 "The file descriptors in this set are watched for \"exceptional "
449 "conditions\". For examples of some exceptional conditions, see the "
450 "discussion of B<POLLPRI> in B<poll>(2)."
451 msgstr ""
452
453 #. type: Plain text
454 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
455 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
456 msgid ""
457 "After B<select>() has returned, I<exceptfds> will be cleared of all file "
458 "descriptors except for those for which an exceptional condition has occurred."
459 msgstr ""
460
461 #. type: TP
462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
464 #, no-wrap
465 msgid "I<nfds>"
466 msgstr "I<nfds>"
467
468 #. type: Plain text
469 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
470 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
471 #, fuzzy
472 #| msgid ""
473 #| "I<nfds> should be set to the highest-numbered file descriptor in any of "
474 #| "the three sets, plus 1. The indicated file descriptors in each set are "
475 #| "checked, up to this limit (but see BUGS)."
476 msgid ""
477 "This argument should be set to the highest-numbered file descriptor in any "
478 "of the three sets, plus 1. The indicated file descriptors in each set are "
479 "checked, up to this limit (but see BUGS)."
480 msgstr ""
481 "Значение I<nfds> должно быть на единицу больше самого большого номера "
482 "файлового дескриптора из всех трёх наборов плюс 1. Указанные файловые "
483 "дескрипторы в каждом наборе проверяются до этого порога (но смотрите "
484 "ДЕФЕКТЫ)."
485
486 #. type: TP
487 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
488 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
489 #, no-wrap
490 msgid "I<timeout>"
491 msgstr "I<timeout>"
492
493 #. type: Plain text
494 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
495 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
496 #, fuzzy
497 #| msgid ""
498 #| "The I<timeout> argument specifies the interval that B<select>() should "
499 #| "block waiting for a file descriptor to become ready. The call will block "
500 #| "until either:"
501 msgid ""
502 "The I<timeout> argument is a I<timeval> structure (shown below) that "
503 "specifies the interval that B<select>() should block waiting for a file "
504 "descriptor to become ready. The call will block until either:"
505 msgstr ""
506 "В аргументе I<timeout> указывается интервал, на который должен "
507 "заблокироваться B<select>() в ожидании готовности файлового дескриптора. "
508 "Вызов будет блокирован пока:"
509
510 #. type: IP
511 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
512 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
513 #, no-wrap
514 msgid "\\[bu]"
515 msgstr "\\[bu]"
516
517 #. type: Plain text
518 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
519 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
520 msgid "a file descriptor becomes ready;"
521 msgstr "файловый дескриптор не станет готов;"
522
523 #. type: Plain text
524 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
525 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
526 msgid "the call is interrupted by a signal handler; or"
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 "the timeout expires."
533 msgstr "не истечёт время ожидания."
534
535 #. type: Plain text
536 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
537 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
538 #, fuzzy
539 #| msgid ""
540 #| "Note that the I<timeout> interval will be rounded up to the system clock "
541 #| "granularity, and kernel scheduling delays mean that the blocking interval "
542 #| "may overrun by a small amount. If both fields of the I<timeval> "
543 #| "structure are zero, then B<select>() returns immediately. (This is "
544 #| "useful for polling.) If I<timeout> is NULL (no timeout), B<select>() "
545 #| "can block indefinitely."
546 msgid ""
547 "Note that the I<timeout> interval will be rounded up to the system clock "
548 "granularity, and kernel scheduling delays mean that the blocking interval "
549 "may overrun by a small amount."
550 msgstr ""
551 "Заметим, что интервал I<timeout> будет округлён с точностью системных часов, "
552 "а из-за задержки при планировании в ядре блокирующий интервал будет немного "
553 "больше. Если оба поля структуры I<timeval> равны нулю, то B<select>() "
554 "завершится немедленно (полезно при опросе (polling)). Если значение "
555 "I<timeout> равно NULL (время ожидания не задано), то B<select>() может "
556 "блокировать работу неопределённо долго."
557
558 #. type: Plain text
559 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
560 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
561 msgid ""
562 "If both fields of the I<timeval> structure are zero, then B<select>() "
563 "returns immediately. (This is useful for polling.)"
564 msgstr ""
565
566 #. type: Plain text
567 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
568 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
569 #, fuzzy
570 #| msgid ""
571 #| "The I<timeout> argument specifies the interval that B<select>() should "
572 #| "block waiting for a file descriptor to become ready. The call will block "
573 #| "until either:"
574 msgid ""
575 "If I<timeout> is specified as NULL, B<select>() blocks indefinitely waiting "
576 "for a file descriptor to become ready."
577 msgstr ""
578 "В аргументе I<timeout> указывается интервал, на который должен "
579 "заблокироваться B<select>() в ожидании готовности файлового дескриптора. "
580 "Вызов будет блокирован пока:"
581
582 #. type: SS
583 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
584 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
585 #, no-wrap
586 msgid "pselect()"
587 msgstr "pselect()"
588
589 #. type: Plain text
590 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
591 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
592 msgid ""
593 "The B<pselect>() system call allows an application to safely wait until "
594 "either a file descriptor becomes ready or until a signal is caught."
595 msgstr ""
596
597 #. type: Plain text
598 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
599 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
600 msgid ""
601 "The operation of B<select>() and B<pselect>() is identical, other than "
602 "these three differences:"
603 msgstr ""
604 "Работа B<select>() и B<pselect>() идентична за исключением трёх моментов:"
605
606 #. type: Plain text
607 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
608 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
609 msgid ""
610 "B<select>() uses a timeout that is a I<struct timeval> (with seconds and "
611 "microseconds), while B<pselect>() uses a I<struct timespec> (with seconds "
612 "and nanoseconds)."
613 msgstr ""
614 "В вызове B<select>() время ожидания задаётся в структуре I<struct timeval> "
615 "(с секундами и микросекундами), а в B<pselect>() используется структура "
616 "I<struct timespec> (с секундами и наносекундами)."
617
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 "B<select>() may update the I<timeout> argument to indicate how much time "
623 "was left. B<pselect>() does not change this argument."
624 msgstr ""
625 "Вызов B<select>() может обновить аргумент I<timeout>, который показывает "
626 "сколько времени прошло. Вызов B<pselect>() не изменяет этот аргумент."
627
628 #. type: Plain text
629 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
630 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
631 msgid ""
632 "B<select>() has no I<sigmask> argument, and behaves as B<pselect>() called "
633 "with NULL I<sigmask>."
634 msgstr ""
635 "Вызов B<select>() не имеет аргумента I<sigmask>, и ведёт себя также как "
636 "B<pselect>(), если при вызове было указано значение I<sigmask> равное NULL."
637
638 #. type: Plain text
639 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
640 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
641 #, fuzzy
642 #| msgid ""
643 #| "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it "
644 #| "is not NULL, then B<pselect>() first replaces the current signal mask by "
645 #| "the one pointed to by I<sigmask>, then does the \"select\" function, and "
646 #| "then restores the original signal mask."
647 msgid ""
648 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
649 "not NULL, then B<pselect>() first replaces the current signal mask by the "
650 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
651 "restores the original signal mask. (If I<sigmask> is NULL, the signal mask "
652 "is not modified during the B<pselect>() call.)"
653 msgstr ""
654 "Значение I<sigmask> является указателем на маску сигналов (смотрите "
655 "B<sigprocmask>(2)); если оно не равно NULL, то сначала B<pselect>() заменяет "
656 "текущую маску сигналов на заданную I<sigmask>, затем выполняет функцию "
657 "«select», после чего восстанавливает первоначальную сигнальную маску."
658
659 #. type: Plain text
660 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
661 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
662 msgid ""
663 "Other than the difference in the precision of the I<timeout> argument, the "
664 "following B<pselect>() call:"
665 msgstr "Кроме различия в точности аргумента I<timeout> вызов B<pselect>()"
666
667 #. type: Plain text
668 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
669 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
670 #, no-wrap
671 msgid ""
672 "ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
673 " timeout, &sigmask);\n"
674 msgstr ""
675 "ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
676 " timeout, &sigmask);\n"
677
678 #. type: Plain text
679 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
680 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
681 msgid "is equivalent to I<atomically> executing the following calls:"
682 msgstr "эквивалентен I<атомарному> выполнению следующих вызовов:"
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 #, fuzzy, no-wrap
688 #| msgid ""
689 #| "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
690 #| "ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
691 #| "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
692 msgid ""
693 "sigset_t origmask;\n"
694 "\\&\n"
695 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
696 "ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
697 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
698 msgstr ""
699 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
700 "ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
701 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
702
703 #. type: Plain text
704 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
705 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
706 msgid ""
707 "The reason that B<pselect>() is needed is that if one wants to wait for "
708 "either a signal or for a file descriptor to become ready, then an atomic "
709 "test is needed to prevent race conditions. (Suppose the signal handler sets "
710 "a global flag and returns. Then a test of this global flag followed by a "
711 "call of B<select>() could hang indefinitely if the signal arrived just "
712 "after the test but just before the call. By contrast, B<pselect>() allows "
713 "one to first block signals, handle the signals that have come in, then call "
714 "B<pselect>() with the desired I<sigmask>, avoiding the race.)"
715 msgstr ""
716 "Причина необходимости B<pselect>() в том, что если нужно ждать какого-то "
717 "сигнала или готовности файлового дескриптора, то необходимо атомарное "
718 "тестирование для избежания состязательности. (Предположим, что обработчик "
719 "сигнала устанавливает глобальный флаг и завершается. В этом случае тест "
720 "этого глобального флага после вызова B<select>() мог бы длиться бесконечно, "
721 "если сигнал прибыл бы сразу после тестирования, но до вызова. В отличие от "
722 "этого, B<pselect>() позволяет сначала заблокировать сигналы, обработать уже "
723 "поступившие и затем вызвать B<pselect>() с желаемым значением I<sigmask>, "
724 "избегая состязательности.)"
725
726 #. type: SS
727 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
728 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
729 #, no-wrap
730 msgid "The timeout"
731 msgstr "Время ожидания"
732
733 #. type: Plain text
734 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
735 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
736 #, fuzzy
737 #| msgid "The file timestamps are structures of the following type:"
738 msgid ""
739 "The I<timeout> argument for B<select>() is a structure of the following "
740 "type:"
741 msgstr "Метки времени файла хранятся в структуре следующего вида:"
742
743 #. type: Plain text
744 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
745 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
746 #, no-wrap
747 msgid ""
748 "struct timeval {\n"
749 " time_t tv_sec; /* seconds */\n"
750 " suseconds_t tv_usec; /* microseconds */\n"
751 "};\n"
752 msgstr ""
753 "struct timeval {\n"
754 " time_t tv_sec; /* секунды */\n"
755 " suseconds_t tv_usec; /* микросекунды */\n"
756 "};\n"
757
758 #. type: Plain text
759 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
760 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
761 msgid ""
762 "The corresponding argument for B<pselect>() is a B<timespec>(3) structure."
763 msgstr ""
764
765 #. .P - it is rumored that:
766 #. On BSD, when a timeout occurs, the file descriptor bits are not changed.
767 #. - it is certainly true that:
768 #. Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
769 #. type: Plain text
770 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
771 #: opensuse-tumbleweed
772 #, fuzzy
773 #| msgid ""
774 #| "On Linux, B<select>() modifies I<timeout> to reflect the amount of time "
775 #| "not slept; most other implementations do not do this. (POSIX.1 permits "
776 #| "either behavior.) This causes problems both when Linux code which reads "
777 #| "I<timeout> is ported to other operating systems, and when code is ported "
778 #| "to Linux that reuses a I<struct timeval> for multiple B<select>()s in a "
779 #| "loop without reinitializing it. Consider I<timeout> to be undefined "
780 #| "after B<select>() returns."
781 msgid ""
782 "On Linux, B<select>() modifies I<timeout> to reflect the amount of time not "
783 "slept; most other implementations do not do this. (POSIX.1 permits either "
784 "behavior.) This causes problems both when Linux code which reads I<timeout> "
785 "is ported to other operating systems, and when code is ported to Linux that "
786 "reuses a I<struct\\ timeval> for multiple B<select>()s in a loop without "
787 "reinitializing it. Consider I<timeout> to be undefined after B<select>() "
788 "returns."
789 msgstr ""
790 "В Linux вызов B<select>() изменяет I<timeout> для отражения времени, "
791 "проведённого не в режиме ожидания; большая часть других реализаций этого не "
792 "делает (согласно POSIX.1 допускается любой из этих вариантов). Это вызывает "
793 "проблемы как при переносе кода Linux, читающего I<timeout>, на другие "
794 "операционные системы, так и при переносе на Linux кода, использующего "
795 "I<struct timeval> для многократного вызова B<select>() в цикле без его "
796 "переинициализации. Во избежание этого следует считать, что значение "
797 "I<timeout> не определено после возврата из B<select>()."
798
799 #. type: SH
800 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
801 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
802 #, no-wrap
803 msgid "RETURN VALUE"
804 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
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 ""
811 #| "On success, B<select>() and B<pselect>() return the number of file "
812 #| "descriptors contained in the three returned descriptor sets (that is, the "
813 #| "total number of bits that are set in I<readfds>, I<writefds>, "
814 #| "I<exceptfds>) which may be zero if the timeout expires before anything "
815 #| "interesting happens. On error, -1 is returned, and I<errno> is set to "
816 #| "indicate the error; the file descriptor sets are unmodified, and "
817 #| "I<timeout> becomes undefined."
818 msgid ""
819 "On success, B<select>() and B<pselect>() return the number of file "
820 "descriptors contained in the three returned descriptor sets (that is, the "
821 "total number of bits that are set in I<readfds>, I<writefds>, "
822 "I<exceptfds>). The return value may be zero if the timeout expired before "
823 "any file descriptors became ready."
824 msgstr ""
825 "При успешном выполнении B<select>() и B<pselect>() возвращают количество "
826 "файловых дескрипторов, находящихся в трёх возвращаемых наборах (то есть, "
827 "общее количество бит, установленных в I<readfds>, I<writefds>, "
828 "I<exceptfds>), при чём это количество может быть нулевым, если время "
829 "ожидания истекло, а интересующие события так и не произошли. При ошибке "
830 "возвращается значение -1, а переменной I<errno> присваивается "
831 "соответствующий номер ошибки; наборы файловых дескрипторов не изменяются и "
832 "значение I<timeout> становится неопределённым."
833
834 #. type: Plain text
835 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
836 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
837 #, fuzzy
838 #| msgid ""
839 #| "On error, -1 is returned and I<errno> is set to indicate the cause of the "
840 #| "error (for example, B<EINVAL>, indicating that I<name> is invalid)."
841 msgid ""
842 "On error, -1 is returned, and I<errno> is set to indicate the error; the "
843 "file descriptor sets are unmodified, and I<timeout> becomes undefined."
844 msgstr ""
845 "При ошибке возвращается -1, а в I<errno> содержится код ошибки (например, "
846 "B<EINVAL> означает, что некорректно I<name>)."
847
848 #. type: SH
849 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
850 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
851 #, no-wrap
852 msgid "ERRORS"
853 msgstr "ОШИБКИ"
854
855 #. type: TP
856 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
857 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
858 #, no-wrap
859 msgid "B<EBADF>"
860 msgstr "B<EBADF>"
861
862 #. type: Plain text
863 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
864 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
865 msgid ""
866 "An invalid file descriptor was given in one of the sets. (Perhaps a file "
867 "descriptor that was already closed, or one on which an error has occurred.) "
868 "However, see BUGS."
869 msgstr ""
870 "В одном из наборов находится неверный файловый дескриптор (возможно файловый "
871 "дескриптор уже закрыт, или при работе с ним произошла ошибка). Однако "
872 "смотрите ДЕФЕКТЫ."
873
874 #. type: TP
875 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
876 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
877 #, no-wrap
878 msgid "B<EINTR>"
879 msgstr "B<EINTR>"
880
881 #. type: Plain text
882 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
883 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
884 msgid "A signal was caught; see B<signal>(7)."
885 msgstr "При выполнении поступил сигнал; см. B<signal>(7)."
886
887 #. type: TP
888 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
889 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
890 #, no-wrap
891 msgid "B<EINVAL>"
892 msgstr "B<EINVAL>"
893
894 #. type: Plain text
895 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
896 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
897 msgid ""
898 "I<nfds> is negative or exceeds the B<RLIMIT_NOFILE> resource limit (see "
899 "B<getrlimit>(2))."
900 msgstr ""
901 "Значение I<nfds> отрицательно или превышает ограничение ресурса "
902 "B<RLIMIT_NOFILE> (смотрите B<getrlimit>(2))."
903
904 #. type: Plain text
905 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
906 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
907 msgid "The value contained within I<timeout> is invalid."
908 msgstr "Значение, содержащееся внутри I<timeout>, некорректно."
909
910 #. type: TP
911 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
912 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
913 #, no-wrap
914 msgid "B<ENOMEM>"
915 msgstr "B<ENOMEM>"
916
917 #. type: Plain text
918 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
919 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
920 msgid "Unable to allocate memory for internal tables."
921 msgstr "Не удалось выделить память для внутренних таблиц."
922
923 #. type: SH
924 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
925 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
926 #, no-wrap
927 msgid "VERSIONS"
928 msgstr "ВЕРСИИ"
929
930 #. Darwin, according to a report by Jeremy Sequoia, relayed by Josh Triplett
931 #. type: Plain text
932 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
933 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
934 msgid ""
935 "On some other UNIX systems, B<select>() can fail with the error B<EAGAIN> "
936 "if the system fails to allocate kernel-internal resources, rather than "
937 "B<ENOMEM> as Linux does. POSIX specifies this error for B<poll>(2), but not "
938 "for B<select>(). Portable programs may wish to check for B<EAGAIN> and "
939 "loop, just as with B<EINTR>."
940 msgstr ""
941 "В некоторых системах UNIX вызов B<select>() может завершаться с ошибкой "
942 "B<EAGAIN>, если системе не удаётся выделить внутренние ресурсы ядра, вместо "
943 "ошибки B<ENOMEM>, как это происходит в Linux. В POSIX эта ошибка указана для "
944 "B<poll>(2), но не для B<select>(). В переносимых программах лучше ожидать "
945 "B<EAGAIN> в цикле, как для B<EINTR>."
946
947 #. type: SH
948 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
949 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
950 #, no-wrap
951 msgid "STANDARDS"
952 msgstr "СТАНДАРТЫ"
953
954 #. type: Plain text
955 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
956 #: opensuse-tumbleweed
957 msgid "POSIX.1-2024."
958 msgstr "POSIX.1-2024."
959
960 #. type: SH
961 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
962 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
963 #, no-wrap
964 msgid "HISTORY"
965 msgstr "ИСТОРИЯ"
966
967 #. type: TP
968 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
969 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
970 #, fuzzy, no-wrap
971 #| msgid "B<select>(2)"
972 msgid "B<select>()"
973 msgstr "B<select>(2)"
974
975 #. type: Plain text
976 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
977 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
978 msgid "POSIX.1-2001, 4.4BSD (first appeared in 4.2BSD)."
979 msgstr "POSIX.1-2001, 4.4BSD (впервые появились в 4.2BSD)."
980
981 #. type: Plain text
982 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
983 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
984 #, fuzzy
985 #| msgid ""
986 #| "B<select>() conforms to POSIX.1-2001, POSIX.1-2008, and 4.4BSD "
987 #| "(B<select>() first appeared in 4.2BSD). Generally portable to/from non-"
988 #| "BSD systems supporting clones of the BSD socket layer (including System\\ "
989 #| "V variants). However, note that the System\\ V variant typically sets "
990 #| "the timeout variable before exit, but the BSD variant does not."
991 msgid ""
992 "Generally portable to/from non-BSD systems supporting clones of the BSD "
993 "socket layer (including System\\ V variants). However, note that the "
994 "System\\ V variant typically sets the timeout variable before returning, but "
995 "the BSD variant does not."
996 msgstr ""
997 "Вызов B<select>() соответствует POSIX.1-2001, POSIX.1-2008 и 4.4BSD (впервые "
998 "B<select>() появился в 4.2BSD). Обычно перенос выполняется с не-BSD систем "
999 "и на них, если они поддерживают уровень BSD-сокетов (включая варианты System "
1000 "V). Однако, заметим, что вариант System V, обычно, устанавливает значение "
1001 "переменной timeout перед выходом, а вариант BSD - нет."
1002
1003 #. type: TP
1004 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1005 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1006 #, fuzzy, no-wrap
1007 #| msgid "B<pselect>():"
1008 msgid "B<pselect>()"
1009 msgstr "B<pselect>():"
1010
1011 #. type: Plain text
1012 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1013 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1014 #, fuzzy
1015 #| msgid "glibc 2.1. C99, POSIX.1-2001."
1016 msgid "Linux 2.6.16. POSIX.1g, POSIX.1-2001."
1017 msgstr "glibc 2.1. C99, POSIX.1-2001."
1018
1019 #. type: Plain text
1020 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1021 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1022 #, fuzzy
1023 #| msgid ""
1024 #| "B<pselect>() was added to Linux in kernel 2.6.16. Prior to this, "
1025 #| "B<pselect>() was emulated in glibc (but see BUGS)."
1026 msgid "Prior to this, it was emulated in glibc (but see BUGS)."
1027 msgstr ""
1028 "Вызов B<pselect>() был добавлен в ядро Linux версии 2.6.16. До этого "
1029 "B<pselect>() эмулировался в glibc (но, см. ДЕФЕКТЫ)."
1030
1031 #. type: TP
1032 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1033 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1034 #, fuzzy, no-wrap
1035 #| msgid "fd_set"
1036 msgid "B<fd_set>"
1037 msgstr "fd_set"
1038
1039 #. type: Plain text
1040 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1041 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1042 msgid "POSIX.1-2001."
1043 msgstr "POSIX.1-2001."
1044
1045 #. type: SH
1046 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1047 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1048 #, no-wrap
1049 msgid "NOTES"
1050 msgstr "ПРИМЕЧАНИЯ"
1051
1052 #. type: Plain text
1053 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1054 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1055 msgid ""
1056 "The following header also provides the I<fd_set> type: I<E<lt>sys/"
1057 "time.hE<gt>>."
1058 msgstr ""
1059
1060 #. type: Plain text
1061 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1062 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1063 msgid ""
1064 "An I<fd_set> is a fixed size buffer. Executing B<FD_CLR>() or B<FD_SET>() "
1065 "with a value of I<fd> that is negative or is equal to or larger than "
1066 "B<FD_SETSIZE> will result in undefined behavior. Moreover, POSIX requires "
1067 "I<fd> to be a valid file descriptor."
1068 msgstr ""
1069 "I<fd_set> представляет собой буфер фиксированного размера. Выполнение "
1070 "B<FD_CLR>() или B<FD_SET>() с отрицательным значением I<fd>, равным или "
1071 "большим чем B<FD_SETSIZE>, приводит к неопределённому поведению. Более того, "
1072 "согласно POSIX I<fd> должен быть корректным файловым дескриптором."
1073
1074 #. type: Plain text
1075 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1076 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1077 msgid ""
1078 "The operation of B<select>() and B<pselect>() is not affected by the "
1079 "B<O_NONBLOCK> flag."
1080 msgstr "На операции B<select>() и B<pselect>() флаг B<O_NONBLOCK> не влияет."
1081
1082 #. type: SS
1083 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1084 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1085 #, no-wrap
1086 msgid "The self-pipe trick"
1087 msgstr ""
1088
1089 #. type: Plain text
1090 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1091 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1092 msgid ""
1093 "On systems that lack B<pselect>(), reliable (and more portable) signal "
1094 "trapping can be achieved using the self-pipe trick. In this technique, a "
1095 "signal handler writes a byte to a pipe whose other end is monitored by "
1096 "B<select>() in the main program. (To avoid possibly blocking when writing "
1097 "to a pipe that may be full or reading from a pipe that may be empty, "
1098 "nonblocking I/O is used when reading from and writing to the pipe.)"
1099 msgstr ""
1100 "В системах без B<pselect>(), надёжного (и более переносимого) перехвата "
1101 "сигнала можно достичь с помощью трюка с каналом в самого себя. В этом методе "
1102 "обработчик сигнала пишет байт в канал, чей второй конец отслеживается "
1103 "B<select>() в основной программе (чтобы избежать возможной блокировки при "
1104 "записи в канал, который может быть заполнен, или при чтении из канала, "
1105 "который может быть пуст, нужно использовать неблокирующий ввод/вывод)."
1106
1107 #. type: SS
1108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1110 #, no-wrap
1111 msgid "Emulating usleep(3)"
1112 msgstr ""
1113
1114 #. type: Plain text
1115 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1116 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1117 #, fuzzy
1118 #| msgid ""
1119 #| "Some code calls B<select>() with all three sets empty, I<nfds> zero, and "
1120 #| "a non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
1121 #| "precision."
1122 msgid ""
1123 "Before the advent of B<usleep>(3), some code employed a call to B<select>() "
1124 "with all three sets empty, I<nfds> zero, and a non-NULL I<timeout> as a "
1125 "fairly portable way to sleep with subsecond precision."
1126 msgstr ""
1127 "Иногда B<select>() вызывается с пустыми наборами (всеми тремя), I<nfds> "
1128 "равным нулю и непустым I<timeout> для переносимой реализации перехода в "
1129 "режим ожидания (sleep) на периоды с точностью менее секунды."
1130
1131 #. type: SS
1132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1134 #, no-wrap
1135 msgid "Correspondence between select() and poll() notifications"
1136 msgstr "Соотношение между уведомлениями select() и poll()"
1137
1138 #. fs/select.c
1139 #. type: Plain text
1140 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1141 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1142 msgid ""
1143 "Within the Linux kernel source, we find the following definitions which show "
1144 "the correspondence between the readable, writable, and exceptional condition "
1145 "notifications of B<select>() and the event notifications provided by "
1146 "B<poll>(2) and B<epoll>(7):"
1147 msgstr ""
1148 "Внутри исходного кода ядра Linux имеются определения, которые показывают "
1149 "соотношение между уведомлениями чтения, записи и исключительного условия "
1150 "B<select>() и уведомляющими событиями, предоставляемыми B<poll>(2) и "
1151 "B<epoll>(7):"
1152
1153 #. type: Plain text
1154 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1155 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1156 #, fuzzy, no-wrap
1157 #| msgid ""
1158 #| "#define POLLIN_SET (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP |\n"
1159 #| " POLLERR)\n"
1160 #| " /* Ready for reading */\n"
1161 #| "#define POLLOUT_SET (POLLWRBAND | POLLWRNORM | POLLOUT | POLLERR)\n"
1162 #| " /* Ready for writing */\n"
1163 #| "#define POLLEX_SET (POLLPRI)\n"
1164 #| " /* Exceptional condition */\n"
1165 msgid ""
1166 "#define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN |\n"
1167 " EPOLLHUP | EPOLLERR)\n"
1168 " /* Ready for reading */\n"
1169 "#define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT |\n"
1170 " EPOLLERR)\n"
1171 " /* Ready for writing */\n"
1172 "#define POLLEX_SET (EPOLLPRI)\n"
1173 " /* Exceptional condition */\n"
1174 msgstr ""
1175 "#define POLLIN_SET (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP |\n"
1176 " POLLERR)\n"
1177 " /* готов для чтения */\n"
1178 "#define POLLOUT_SET (POLLWRBAND | POLLWRNORM | POLLOUT | POLLERR)\n"
1179 " /* готов для записи */\n"
1180 "#define POLLEX_SET (POLLPRI)\n"
1181 " /* исключительное условие */\n"
1182
1183 #. type: SS
1184 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1185 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1186 #, no-wrap
1187 msgid "Multithreaded applications"
1188 msgstr "Многонитевые приложения"
1189
1190 #. type: Plain text
1191 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1192 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1193 msgid ""
1194 "If a file descriptor being monitored by B<select>() is closed in another "
1195 "thread, the result is unspecified. On some UNIX systems, B<select>() "
1196 "unblocks and returns, with an indication that the file descriptor is ready "
1197 "(a subsequent I/O operation will likely fail with an error, unless another "
1198 "process reopens the file descriptor between the time B<select>() returned "
1199 "and the I/O operation is performed). On Linux (and some other systems), "
1200 "closing the file descriptor in another thread has no effect on B<select>(). "
1201 "In summary, any application that relies on a particular behavior in this "
1202 "scenario must be considered buggy."
1203 msgstr ""
1204 "Если файловой дескриптор, отслеживаемый B<select>(), закрывается в другой "
1205 "нити, то результат непредсказуем. В некоторых системах UNIX B<select>() "
1206 "разблокируется и возвращает выполнение с указанием того, что файловый "
1207 "дескриптор готов (последующая операция ввода-вывода, вероятно, завершится с "
1208 "ошибкой, если другой процесс не переоткроет файловый дескриптор между "
1209 "возвратом B<select>() и выполнением операции ввода-вывода). В Linux (и "
1210 "некоторых других системах), закрытие файлового дескриптора в другой нити не "
1211 "влияет на B<select>(). Резюмируя, любое приложение, которое полагается на "
1212 "определённое поведение в таком сценарии, должно считаться ошибочным."
1213
1214 #. type: SS
1215 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1216 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1217 #, no-wrap
1218 msgid "C library/kernel differences"
1219 msgstr "Отличия между библиотекой C и ядром"
1220
1221 #. type: Plain text
1222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1224 msgid ""
1225 "The Linux kernel allows file descriptor sets of arbitrary size, determining "
1226 "the length of the sets to be checked from the value of I<nfds>. However, in "
1227 "the glibc implementation, the I<fd_set> type is fixed in size. See also "
1228 "BUGS."
1229 msgstr ""
1230 "Ядро Linux разрешает наборы файловых дескрипторов любого размера, определяя "
1231 "длину набора по значению I<nfds>. Однако в реализации glibc тип I<fd_set> "
1232 "имеет фиксированный размер. Смотрите также ДЕФЕКТЫ."
1233
1234 #. type: Plain text
1235 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1236 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1237 msgid ""
1238 "The B<pselect>() interface described in this page is implemented by glibc. "
1239 "The underlying Linux system call is named B<pselect6>(). This system call "
1240 "has somewhat different behavior from the glibc wrapper function."
1241 msgstr ""
1242 "Интерфейс B<pselect>(), описанный в этой странице, реализован в glibc. Для "
1243 "этого используется системный вызов B<pselect6>(). Поведение данного "
1244 "системного вызова несколько отличается от обёрточной функции glibc."
1245
1246 #. type: Plain text
1247 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1248 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1249 msgid ""
1250 "The Linux B<pselect6>() system call modifies its I<timeout> argument. "
1251 "However, the glibc wrapper function hides this behavior by using a local "
1252 "variable for the timeout argument that is passed to the system call. Thus, "
1253 "the glibc B<pselect>() function does not modify its I<timeout> argument; "
1254 "this is the behavior required by POSIX.1-2001."
1255 msgstr ""
1256 "В Linux системный вызов B<pselect6>() изменяет содержимое своего аргумента "
1257 "I<timeout>. Однако, обёрточная функция glibc скрывает это поведение "
1258 "используя локальную переменную для аргумента timeout при передаче в "
1259 "системный вызов. Таким образом, функция B<pselect>() в glibc не изменяет "
1260 "свой аргумент I<timeout>; это поведение требуется в POSIX.1-2001."
1261
1262 #. type: Plain text
1263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1265 msgid ""
1266 "The final argument of the B<pselect6>() system call is not a I<sigset_t\\ "
1267 "*> pointer, but is instead a structure of the form:"
1268 msgstr ""
1269 "Последний аргумент системного вызова B<pselect6>() не является указателем "
1270 "I<sigset_t\\ *>, он представляет собой структуру в виде:"
1271
1272 #. type: Plain text
1273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1275 #, fuzzy, no-wrap
1276 #| msgid ""
1277 #| "struct {\n"
1278 #| " const kernel_sigset_t *ss; /* Pointer to signal set */\n"
1279 #| " size_t ss_len; /* Size (in bytes) of object\n"
1280 #| " pointed to by \\(aqss\\(aq */\n"
1281 #| "};\n"
1282 msgid ""
1283 "struct {\n"
1284 " const kernel_sigset_t *ss; /* Pointer to signal set */\n"
1285 " size_t ss_len; /* Size (in bytes) of object\n"
1286 " pointed to by \\[aq]ss\\[aq] */\n"
1287 "};\n"
1288 msgstr ""
1289 "struct {\n"
1290 " const kernel_sigset_t *ss; /* указатель на набор сигналов */\n"
1291 " size_t ss_len; /* размер (в байтах) объекта,\n"
1292 " на который указывает \\(aqss\\(aq */\n"
1293 "};\n"
1294
1295 #. type: Plain text
1296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1298 msgid ""
1299 "This allows the system call to obtain both a pointer to the signal set and "
1300 "its size, while allowing for the fact that most architectures support a "
1301 "maximum of 6 arguments to a system call. See B<sigprocmask>(2) for a "
1302 "discussion of the difference between the kernel and libc notion of the "
1303 "signal set."
1304 msgstr ""
1305 "Это позволяет системному вызову получить указатель на набор сигналов и его "
1306 "размер, так как в большинстве архитектур системным вызовам можно передать "
1307 "максимум 6 аргументов. В B<sigprocmask>(2) смотрите описание различий между "
1308 "обозначением набора сигналов в ядре и libc."
1309
1310 #. type: SS
1311 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1312 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1313 #, fuzzy, no-wrap
1314 #| msgid "Historical details"
1315 msgid "Historical glibc details"
1316 msgstr "Историческая справка"
1317
1318 #. type: Plain text
1319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1321 #, fuzzy
1322 #| msgid ""
1323 #| "Glibc 2.0 provided a version of B<pselect>() that did not take a "
1324 #| "I<sigmask> argument."
1325 msgid ""
1326 "glibc 2.0 provided an incorrect version of B<pselect>() that did not take a "
1327 "I<sigmask> argument."
1328 msgstr ""
1329 "Glibc 2.0 предоставляет версию B<pselect>(), которая не принимает аргумент "
1330 "I<sigmask>."
1331
1332 #. type: Plain text
1333 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1334 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1335 msgid ""
1336 "From glibc 2.1 to glibc 2.2.1, one must define B<_GNU_SOURCE> in order to "
1337 "obtain the declaration of B<pselect>() from I<E<lt>sys/select.hE<gt>>."
1338 msgstr ""
1339
1340 #. type: SH
1341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1343 #, no-wrap
1344 msgid "BUGS"
1345 msgstr "ПРОГРАММНЫЕ ОШИБКИ"
1346
1347 #. type: Plain text
1348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1350 #, fuzzy
1351 #| msgid ""
1352 #| "POSIX allows an implementation to define an upper limit, advertised via "
1353 #| "the constant B<FD_SETSIZE>, on the range of file descriptors that can be "
1354 #| "specified in a file descriptor set. The Linux kernel imposes no fixed "
1355 #| "limit, but the glibc implementation makes I<fd_set> a fixed-size type, "
1356 #| "with B<FD_SETSIZE> defined as 1024, and the B<FD_*>() macros operating "
1357 #| "according to that limit. To monitor file descriptors greater than 1023, "
1358 #| "use B<poll>(2) instead."
1359 msgid ""
1360 "POSIX allows an implementation to define an upper limit, advertised via the "
1361 "constant B<FD_SETSIZE>, on the range of file descriptors that can be "
1362 "specified in a file descriptor set. The Linux kernel imposes no fixed "
1363 "limit, but the glibc implementation makes I<fd_set> a fixed-size type, with "
1364 "B<FD_SETSIZE> defined as 1024, and the B<FD_*>() macros operating according "
1365 "to that limit. To monitor file descriptors greater than 1023, use "
1366 "B<poll>(2) or B<epoll>(7) instead."
1367 msgstr ""
1368 "В POSIX разрешено в реализации определять верхнее ограничение, объявляемое "
1369 "через константу B<FD_SETSIZE>, для диапазона файловых дескрипторов, который "
1370 "можно задать в наборе файловых дескрипторов. Ядро Linux не имеет "
1371 "фиксированного ограничения, но реализация glibc использует тип I<fd_set> "
1372 "постоянного размера, определяет B<FD_SETSIZE> равным 1024, а также "
1373 "предоставляет набор макросов операций B<FD_*>(), учитывающих это "
1374 "ограничение. Для слежения за файловыми дескрипторами большими чем 1023 "
1375 "используйте вызов B<poll>(2)."
1376
1377 #. type: Plain text
1378 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1379 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1380 #, fuzzy
1381 #| msgid ""
1382 #| "The implementation of the I<fd_set> arguments as value-result arguments "
1383 #| "means that they must be reinitialized on each call to B<select>(). This "
1384 #| "design error is avoided by B<poll>(2), which uses separate structure "
1385 #| "fields for the input and output of the call."
1386 msgid ""
1387 "The implementation of the I<fd_set> arguments as value-result arguments is a "
1388 "design error that is avoided in B<poll>(2) and B<epoll>(7)."
1389 msgstr ""
1390 "Реализация аргументов I<fd_set> в виде аргументов значение-результат "
1391 "означает, что они должен инициализироваться перед каждым вызовом "
1392 "B<select>(). Такой ошибки проектирования избежали в B<poll>(2), где "
1393 "используется отдельные поля структуры для входных и выходных параметров "
1394 "вызова."
1395
1396 #. type: Plain text
1397 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1398 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1399 msgid ""
1400 "According to POSIX, B<select>() should check all specified file descriptors "
1401 "in the three file descriptor sets, up to the limit I<nfds-1>. However, the "
1402 "current implementation ignores any file descriptor in these sets that is "
1403 "greater than the maximum file descriptor number that the process currently "
1404 "has open. According to POSIX, any such file descriptor that is specified in "
1405 "one of the sets should result in the error B<EBADF>."
1406 msgstr ""
1407 "Согласно POSIX, B<select>() должен проверять все файловые дескрипторы, "
1408 "указанные в трёх наборах файловых дескрипторов до верхнего порога I<nfds-1>. "
1409 "Однако текущая реализация игнорирует любой файловый дескриптор в этих "
1410 "наборах, значение которого больше максимального номера файлового "
1411 "дескриптора, который в настоящий момент открыт процессом. Согласно POSIX, "
1412 "такой файловый дескриптор, указанный в любом наборе, должен приводить к "
1413 "ошибке B<EBADF>."
1414
1415 #. type: Plain text
1416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1418 #, fuzzy
1419 #| msgid ""
1420 #| "Starting with version 2.1, glibc provided an emulation of B<pselect>() "
1421 #| "that was implemented using B<sigprocmask>(2) and B<select>(). This "
1422 #| "implementation remained vulnerable to the very race condition that "
1423 #| "B<pselect>() was designed to prevent. Modern versions of glibc use the "
1424 #| "(race-free) B<pselect>() system call on kernels where it is provided."
1425 msgid ""
1426 "Starting with glibc 2.1, glibc provided an emulation of B<pselect>() that "
1427 "was implemented using B<sigprocmask>(2) and B<select>(). This "
1428 "implementation remained vulnerable to the very race condition that "
1429 "B<pselect>() was designed to prevent. Modern versions of glibc use the "
1430 "(race-free) B<pselect>() system call on kernels where it is provided."
1431 msgstr ""
1432 "Начиная с версии 2.1, glibc предоставляет эмуляцию B<pselect>(), которая "
1433 "реализована с помощью B<sigprocmask>(2) и B<select>(). Эта реализация "
1434 "остаётся уязвимой к той самой состязательности, для устранения которой и был "
1435 "разработан B<pselect>(). В современных версии glibc используется "
1436 "(бессостязательный) системный вызов B<pselect>(), если он предоставляется "
1437 "ядром."
1438
1439 #. Stevens discusses a case where accept can block after select
1440 #. returns successfully because of an intervening RST from the client.
1441 #. Maybe the kernel should have returned EIO in such a situation?
1442 #. type: Plain text
1443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1445 #, fuzzy
1446 #| msgid ""
1447 #| "Under Linux, B<select>() may report a socket file descriptor as \"ready "
1448 #| "for reading\", while nevertheless a subsequent read blocks. This could "
1449 #| "for example happen when data has arrived but upon examination has wrong "
1450 #| "checksum and is discarded. There may be other circumstances in which a "
1451 #| "file descriptor is spuriously reported as ready. Thus it may be safer to "
1452 #| "use B<O_NONBLOCK> on sockets that should not block."
1453 msgid ""
1454 "On Linux, B<select>() may report a socket file descriptor as \"ready for "
1455 "reading\", while nevertheless a subsequent read blocks. This could for "
1456 "example happen when data has arrived but upon examination has the wrong "
1457 "checksum and is discarded. There may be other circumstances in which a file "
1458 "descriptor is spuriously reported as ready. Thus it may be safer to use "
1459 "B<O_NONBLOCK> on sockets that should not block."
1460 msgstr ""
1461 "В Linux, вызов B<select>() может сообщать о файловом дескрипторе сокета как "
1462 "о «готовом для чтения», хотя при последующем чтении произойдёт блокировка. "
1463 "Это может случиться, например, когда данные прибыли, но при анализе их "
1464 "контрольная сумма не совпала и они были отброшены. Также могут быть другие "
1465 "обстоятельства, при которых файловый дескриптор ошибочно считается готовым. "
1466 "Поэтому, возможно безопасней будет использовать для сокетов B<O_NONBLOCK>, "
1467 "которые не должны блокироваться."
1468
1469 #. type: Plain text
1470 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1471 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1472 msgid ""
1473 "On Linux, B<select>() also modifies I<timeout> if the call is interrupted "
1474 "by a signal handler (i.e., the B<EINTR> error return). This is not "
1475 "permitted by POSIX.1. The Linux B<pselect>() system call has the same "
1476 "behavior, but the glibc wrapper hides this behavior by internally copying "
1477 "the I<timeout> to a local variable and passing that variable to the system "
1478 "call."
1479 msgstr ""
1480 "В Linux, вызов B<select>() также изменяет I<timeout>, если он прерван "
1481 "обработчиком сигнала (т. е., возвращается ошибка B<EINTR>). Согласно POSIX.1 "
1482 "это не разрешено. В Linux системный вызов B<pselect>() действует также, но "
1483 "обёртка glibc скрывает это поведение копируя перед вызовом I<timeout> в "
1484 "локальную переменную и передавая её в системный вызов."
1485
1486 #. type: SH
1487 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1488 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1489 #, no-wrap
1490 msgid "EXAMPLES"
1491 msgstr "ПРИМЕРЫ"
1492
1493 #. type: Plain text
1494 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1495 #: opensuse-tumbleweed
1496 #, no-wrap
1497 msgid ""
1498 "#include E<lt>stdio.hE<gt>\n"
1499 "#include E<lt>stdlib.hE<gt>\n"
1500 "#include E<lt>sys/select.hE<gt>\n"
1501 "#include E<lt>sys/time.hE<gt>\n"
1502 "\\&\n"
1503 "int\n"
1504 "main(void)\n"
1505 "{\n"
1506 " int retval;\n"
1507 " fd_set rfds;\n"
1508 " struct timeval tv;\n"
1509 "\\&\n"
1510 " /* Watch stdin (fd 0) to see when it has input. */\n"
1511 "\\&\n"
1512 " FD_ZERO(&rfds);\n"
1513 " FD_SET(0, &rfds);\n"
1514 "\\&\n"
1515 " /* Wait up to five seconds. */\n"
1516 "\\&\n"
1517 " tv.tv_sec = 5;\n"
1518 " tv.tv_usec = 0;\n"
1519 "\\&\n"
1520 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
1521 " /* Don\\[aq]t rely on the value of tv now! */\n"
1522 "\\&\n"
1523 " if (retval == -1)\n"
1524 " perror(\"select()\");\n"
1525 " else if (retval)\n"
1526 " printf(\"Data is available now.\\[rs]n\");\n"
1527 " /* FD_ISSET(0, &rfds) will be true. */\n"
1528 " else\n"
1529 " printf(\"No data within five seconds.\\[rs]n\");\n"
1530 "\\&\n"
1531 " exit(EXIT_SUCCESS);\n"
1532 "}\n"
1533 msgstr ""
1534
1535 #. SRC END
1536 #. type: SH
1537 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1538 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1539 #, no-wrap
1540 msgid "SEE ALSO"
1541 msgstr "СМОТРИТЕ ТАКЖЕ"
1542
1543 #. type: Plain text
1544 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1545 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1546 msgid ""
1547 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
1548 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
1549 "B<timespec>(3), B<epoll>(7), B<time>(7)"
1550 msgstr ""
1551 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
1552 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
1553 "B<timespec>(3), B<epoll>(7), B<time>(7)"
1554
1555 #. type: Plain text
1556 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1557 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1558 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
1559 msgstr "Обсуждение и примеры смотрите в B<select_tut>(2)."
1560
1561 #. type: TH
1562 #: debian-trixie
1563 #, no-wrap
1564 msgid "2024-06-15"
1565 msgstr "15 июня 2024 г."
1566
1567 #. type: TH
1568 #: debian-trixie
1569 #, no-wrap
1570 msgid "Linux man-pages 6.9.1"
1571 msgstr "Страницы руководства Linux 6.9.1"
1572
1573 #. type: Plain text
1574 #: debian-trixie
1575 msgid "Standard C library (I<libc>, I<-lc>)"
1576 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
1577
1578 #. type: Plain text
1579 #: debian-trixie fedora-44 fedora-rawhide
1580 #, no-wrap
1581 msgid "B<typedef> /* ... */ B<fd_set;>\n"
1582 msgstr "B<typedef> /* ... */ B<fd_set;>\n"
1583
1584 #. type: Plain text
1585 #: debian-trixie fedora-44 fedora-rawhide
1586 #, no-wrap
1587 msgid ""
1588 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1589 "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1590 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1591 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
1592 msgstr ""
1593 "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1594 "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1595 "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
1596 "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
1597
1598 #. .P - it is rumored that:
1599 #. On BSD, when a timeout occurs, the file descriptor bits are not changed.
1600 #. - it is certainly true that:
1601 #. Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
1602 #. type: Plain text
1603 #: debian-trixie fedora-44 fedora-rawhide
1604 msgid ""
1605 "On Linux, B<select>() modifies I<timeout> to reflect the amount of time not "
1606 "slept; most other implementations do not do this. (POSIX.1 permits either "
1607 "behavior.) This causes problems both when Linux code which reads I<timeout> "
1608 "is ported to other operating systems, and when code is ported to Linux that "
1609 "reuses a I<struct timeval> for multiple B<select>()s in a loop without "
1610 "reinitializing it. Consider I<timeout> to be undefined after B<select>() "
1611 "returns."
1612 msgstr ""
1613 "В Linux вызов B<select>() изменяет I<timeout> для отражения времени, "
1614 "проведённого не в режиме ожидания; большая часть других реализаций этого не "
1615 "делает (согласно POSIX.1 допускается любой из этих вариантов). Это вызывает "
1616 "проблемы как при переносе кода Linux, читающего I<timeout>, на другие "
1617 "операционные системы, так и при переносе на Linux кода, использующего "
1618 "I<struct timeval> для многократного вызова B<select>() в цикле без его "
1619 "переинициализации. Во избежание этого следует считать, что значение "
1620 "I<timeout> не определено после возврата из B<select>()."
1621
1622 #. type: Plain text
1623 #: debian-trixie fedora-44 fedora-rawhide
1624 msgid "POSIX.1-2008."
1625 msgstr "POSIX.1-2008."
1626
1627 #. type: Plain text
1628 #: debian-trixie
1629 #, no-wrap
1630 msgid ""
1631 "#include E<lt>stdio.hE<gt>\n"
1632 "#include E<lt>stdlib.hE<gt>\n"
1633 "#include E<lt>sys/select.hE<gt>\n"
1634 "\\&\n"
1635 "int\n"
1636 "main(void)\n"
1637 "{\n"
1638 " int retval;\n"
1639 " fd_set rfds;\n"
1640 " struct timeval tv;\n"
1641 "\\&\n"
1642 " /* Watch stdin (fd 0) to see when it has input. */\n"
1643 "\\&\n"
1644 " FD_ZERO(&rfds);\n"
1645 " FD_SET(0, &rfds);\n"
1646 "\\&\n"
1647 " /* Wait up to five seconds. */\n"
1648 "\\&\n"
1649 " tv.tv_sec = 5;\n"
1650 " tv.tv_usec = 0;\n"
1651 "\\&\n"
1652 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
1653 " /* Don\\[aq]t rely on the value of tv now! */\n"
1654 "\\&\n"
1655 " if (retval == -1)\n"
1656 " perror(\"select()\");\n"
1657 " else if (retval)\n"
1658 " printf(\"Data is available now.\\[rs]n\");\n"
1659 " /* FD_ISSET(0, &rfds) will be true. */\n"
1660 " else\n"
1661 " printf(\"No data within five seconds.\\[rs]n\");\n"
1662 "\\&\n"
1663 " exit(EXIT_SUCCESS);\n"
1664 "}\n"
1665 msgstr ""
1666
1667 #. type: TH
1668 #: fedora-44 fedora-rawhide
1669 #, no-wrap
1670 msgid "2024-11-03"
1671 msgstr "3 ноября 2024 г."
1672
1673 #. type: TH
1674 #: fedora-44 fedora-rawhide
1675 #, no-wrap
1676 msgid "Linux man-pages 6.13"
1677 msgstr "Страницы руководства Linux 6.13"
1678
1679 #. type: Plain text
1680 #: fedora-44 fedora-rawhide
1681 #, no-wrap
1682 msgid ""
1683 "#include E<lt>stdio.hE<gt>\n"
1684 "#include E<lt>stdlib.hE<gt>\n"
1685 "#include E<lt>sys/select.hE<gt>\n"
1686 "#include E<lt>sys/time.hE<gt>\n"
1687 "\\&\n"
1688 "int\n"
1689 "main(void)\n"
1690 "{\n"
1691 " int retval;\n"
1692 " fd_set rfds;\n"
1693 " struct timeval tv;\n"
1694 "\\&\n"
1695 " /* Watch stdin (fd 0) to see when it has input. */\n"
1696 "\\&\n"
1697 " FD_ZERO(&rfds);\n"
1698 " FD_SET(0, &rfds);\n"
1699 "\\&\n"
1700 " /* Wait up to five seconds. */\n"
1701 "\\&\n"
1702 " tv.tv_sec = 5;\n"
1703 " tv.tv_usec = 0;\n"
1704 "\\&\n"
1705 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
1706 " /* Don\\[aq]t rely on the value of tv now! */\n"
1707 "\\&\n"
1708 " if (retval == -1)\n"
1709 " perror(\"select()\");\n"
1710 " else if (retval)\n"
1711 " printf(\"Data is available now.\\[rs]n\");\n"
1712 " /* FD_ISSET(0, &rfds) will be true. */\n"
1713 " else\n"
1714 " printf(\"No data within five seconds.\\[rs]n\");\n"
1715 "\\&\n"
1716 " exit(EXIT_SUCCESS);\n"
1717 "}\n"
1718 msgstr ""
1719
1720 #. type: TH
1721 #: mageia-cauldron
1722 #, no-wrap
1723 msgid "Linux man-pages 6.17"
1724 msgstr "Страницы руководства Linux 6.17"
1725
1726 #. type: TH
1727 #: opensuse-leap-16-1 opensuse-tumbleweed
1728 #, no-wrap
1729 msgid "Linux man-pages (unreleased)"
1730 msgstr "Страницы руководства Linux (не выпущены)"