Debian Codegraph @

po/ru/man2/close.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 # Dmitry Bolkhovskikh <[email protected]>, 2017.
5 # Yuri Kozlov <[email protected]>, 2012-2019.
6 # Aleksandr Felda <[email protected]>, 2024.
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: manpages-l10n 4.22.0\n"
10 "POT-Creation-Date: 2026-06-05 06:20+0200\n"
11 "PO-Revision-Date: 2024-12-21 19:49+0300\n"
12 "Last-Translator: Aleksandr Felda <[email protected]>\n"
13 "Language-Team: Russian <[email protected]>\n"
14 "Language: ru\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
19 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
20 "X-Generator: Poedit 3.2.2\n"
21
22 #. type: TH
23 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
24 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
25 #, no-wrap
26 msgid "close"
27 msgstr "close"
28
29 #. type: TH
30 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
31 #: opensuse-tumbleweed
32 #, no-wrap
33 msgid "2026-02-08"
34 msgstr "8 февраля 2026 г."
35
36 #. type: TH
37 #: archlinux debian-unstable
38 #, fuzzy, no-wrap
39 #| msgid "Linux man-pages 6.17"
40 msgid "Linux man-pages 6.18"
41 msgstr "Справочные страницы Linux 6.17"
42
43 #. type: SH
44 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
45 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
46 #, no-wrap
47 msgid "NAME"
48 msgstr "НАИМЕНОВАНИЕ"
49
50 #. type: Plain text
51 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
52 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
53 msgid "close - close a file descriptor"
54 msgstr "close - закрывает файловый дескриптор"
55
56 #. type: SH
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 #, no-wrap
60 msgid "LIBRARY"
61 msgstr "БИБЛИОТЕКА"
62
63 #. type: Plain text
64 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
65 #: opensuse-leap-16-1 opensuse-tumbleweed
66 msgid "Standard C library (I<libc>,\\ I<-lc>)"
67 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
68
69 #. type: SH
70 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
71 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
72 #, no-wrap
73 msgid "SYNOPSIS"
74 msgstr "СИНТАКСИС"
75
76 #. type: Plain text
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid "B<#include E<lt>unistd.hE<gt>>\n"
81 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
82
83 #. type: Plain text
84 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
85 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
86 #, no-wrap
87 msgid "B<int close(int >I<fd>B<);>\n"
88 msgstr "B<int close(int >I<fd>B<);>\n"
89
90 #. type: SH
91 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
92 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
93 #, no-wrap
94 msgid "DESCRIPTION"
95 msgstr "ОПИСАНИЕ"
96
97 #. type: Plain text
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 msgid ""
101 "B<close>() closes a file descriptor, so that it no longer refers to any "
102 "file and may be reused. Any record locks (see B<fcntl>(2)) held on the "
103 "file it was associated with, and owned by the process, are removed "
104 "regardless of the file descriptor that was used to obtain the lock. This "
105 "has some unfortunate consequences and one should be extra careful when using "
106 "advisory record locking. See B<fcntl>(2) for discussion of the risks and "
107 "consequences as well as for the (probably preferred) open file description "
108 "locks."
109 msgstr ""
110 "Программа B<close>() закрывает файловый дескриптор, так что он больше не "
111 "ссылается ни на какой файл и может быть использован повторно. Любые "
112 "блокировки записей (смотрите B<fcntl>(2)), сохраненные в файле, с которым он "
113 "был связан и которым владел процесс, удаляются независимо от файлового "
114 "дескриптора, который использовался для получения блокировки. Это имеет "
115 "некоторые печальные последствия и следует быть особенно осторожным при "
116 "использовании рекомендуемой блокировки записей. Смотрите в B<fcntl>(2) о "
117 "рисках и последствиях, а также (вероятно, предпочтительных) блокировках "
118 "дескрипторов открытых файлов."
119
120 #. type: Plain text
121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
123 msgid ""
124 "If I<fd> is the last file descriptor referring to the underlying open file "
125 "description (see B<open>(2)), the resources associated with the open file "
126 "description are freed; if the file descriptor was the last reference to a "
127 "file which has been removed using B<unlink>(2), the file is deleted."
128 msgstr ""
129 "Если I<fd> является последним файловым дескриптором, ссылающимся на базовый "
130 "дескриптор открытого файла (смотрите B<open>(2), то ресурсы, связанные с "
131 "дескриптором открытого файла, освобождаются; если файловый дескриптор был "
132 "последней ссылкой на файл, удалённый с помощью B<unlink>(2), то файл "
133 "окончательно удаляется."
134
135 #. type: SH
136 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
137 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
138 #, no-wrap
139 msgid "RETURN VALUE"
140 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
141
142 #. type: Plain text
143 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
144 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
145 msgid ""
146 "B<close>() returns zero on success. On error, -1 is returned, and I<errno> "
147 "is set to indicate the error."
148 msgstr ""
149 "При успешном выполнении программы B<close>() возвращается 0. В случае ошибки "
150 "возвращается -1, а значение I<errno> указывает на ошибку."
151
152 #. type: SH
153 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
154 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
155 #, no-wrap
156 msgid "ERRORS"
157 msgstr "ОШИБКИ"
158
159 #. type: TP
160 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
161 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
162 #, no-wrap
163 msgid "B<EBADF>"
164 msgstr "B<EBADF>"
165
166 #. type: Plain text
167 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
168 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
169 msgid "I<fd> isn't a valid open file descriptor."
170 msgstr "Значение I<fd> не является допустимым дескриптором открытого файла."
171
172 #. type: TP
173 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
174 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
175 #, no-wrap
176 msgid "B<EINTR>"
177 msgstr "B<EINTR>"
178
179 #. Though, it's in doubt whether this error can ever occur; see
180 #. https://lwn.net/Articles/576478/ "Returning EINTR from close()"
181 #. type: Plain text
182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
184 msgid "The B<close>() call was interrupted by a signal; see B<signal>(7)."
185 msgstr "Вызов B<close>() был прерван по сигналу; смотрите B<signal>(7)."
186
187 #. type: TP
188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
190 #, no-wrap
191 msgid "B<EIO>"
192 msgstr "B<EIO>"
193
194 #. type: Plain text
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 msgid "An I/O error occurred."
198 msgstr "Произошла ошибка ввода-вывода."
199
200 #. type: TP
201 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
202 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
203 #, no-wrap
204 msgid "B<ENOSPC>"
205 msgstr "B<ENOSPC>"
206
207 #. type: TQ
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<EDQUOT>"
212 msgstr "B<EDQUOT>"
213
214 #. type: Plain text
215 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
216 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
217 msgid ""
218 "On NFS, these errors are not normally reported against the first write which "
219 "exceeds the available storage space, but instead against a subsequent "
220 "B<write>(2), B<fsync>(2), or B<close>()."
221 msgstr ""
222 "В NFS об этих ошибках, обычно, не сообщается при первой записи, которая "
223 "превысила доступное пространство памяти, а только при последующих операциях "
224 "B<write>(), B<fsync>(2) или B<close>()."
225
226 #. type: Plain text
227 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
228 #: opensuse-tumbleweed
229 #, fuzzy
230 #| msgid ""
231 #| "See NOTES for a discussion of why B<close>() should not be retried after "
232 #| "an error."
233 msgid ""
234 "See CAVEATS for a discussion of why B<close>() should not be retried after "
235 "an error."
236 msgstr ""
237 "Смотрите ПРИМЕЧАНИЯ к обсуждению почему B<close>() нельзя вызывать снова "
238 "после ошибки."
239
240 #. type: SH
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 #, no-wrap
244 msgid "STANDARDS"
245 msgstr "СТАНДАРТЫ"
246
247 #. type: Plain text
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 msgid "POSIX.1-2008."
251 msgstr "POSIX.1-2008."
252
253 #. type: SH
254 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
255 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
256 #, no-wrap
257 msgid "HISTORY"
258 msgstr "ИСТОРИЯ"
259
260 #. SVr4 documents an additional ENOLINK error condition.
261 #. type: Plain text
262 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
263 #: opensuse-tumbleweed
264 #, fuzzy
265 #| msgid "4.4BSD, SVr4, POSIX.1-2001."
266 msgid "4.3BSD, SVr4, POSIX.1-1988."
267 msgstr "4.4BSD, SVr4, POSIX.1-2001."
268
269 #. type: SH
270 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
271 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
272 #, no-wrap
273 msgid "NOTES"
274 msgstr "ПРИМЕЧАНИЯ"
275
276 #. type: Plain text
277 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
278 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
279 msgid ""
280 "The close-on-exec file descriptor flag can be used to ensure that a file "
281 "descriptor is automatically closed upon a successful B<execve>(2); see "
282 "B<fcntl>(2) for details."
283 msgstr ""
284 "Флаг файлового дескриптора close-on-exec можно использовать для гарантии "
285 "того, что файловый дескриптор автоматически закроется при успешном "
286 "выполнении B<execve>(2). Смотрите подробности в B<fcntl>(2)."
287
288 #. type: SH
289 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
290 #: opensuse-tumbleweed
291 #, no-wrap
292 msgid "CAVEATS"
293 msgstr ""
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 "A successful close does not guarantee that the data has been successfully "
300 "saved to disk, as the kernel uses the buffer cache to defer writes. "
301 "Typically, filesystems do not flush buffers when a file is closed. If you "
302 "need to be sure that the data is physically stored on the underlying disk, "
303 "use B<fsync>(2). (It will depend on the disk hardware at this point.)"
304 msgstr ""
305 "Выполнение закрытия без ошибок не гарантирует, что данные были успешно "
306 "записаны на диск, так как в ядре используется буферный кэш для отложенных "
307 "записей. Как правило, файловые системы не записывают буферы при закрытии "
308 "файла. Если требуется гарантировать физическую запись на используемый диск, "
309 "то можно использовать B<fsync>(2) (дальше всё будет зависеть от аппаратурных "
310 "особенностей диска)."
311
312 #. type: SS
313 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
314 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
315 #, no-wrap
316 msgid "Multithreaded processes and close()"
317 msgstr "Многопоточные процессы и close()"
318
319 #. #-#-#-#-# archlinux: close.2.pot (PACKAGE VERSION) #-#-#-#-#
320 #. Date: Tue, 4 Sep 2007 13:57:35 +0200
321 #. From: Fredrik Noring <[email protected]>
322 #. One such race involves signals and ERESTARTSYS. If a file descriptor
323 #. in use by a system call is closed and then reused by, e.g., an
324 #. independent open() in some unrelated thread, before the original system
325 #. call has restarted after ERESTARTSYS, the original system call will
326 #. later restart with the reused file descriptor. This is most likely a
327 #. serious programming error.
328 #. type: Plain text
329 #. #-#-#-#-# debian-trixie: close.2.pot (PACKAGE VERSION) #-#-#-#-#
330 #. Date: Tue, 4 Sep 2007 13:57:35 +0200
331 #. From: Fredrik Noring <[email protected]>
332 #. One such race involves signals and ERESTARTSYS. If a file descriptor
333 #. in use by a system call is closed and then reused by e.g. an
334 #. independent open() in some unrelated thread, before the original system
335 #. call has restarted after ERESTARTSYS, the original system call will
336 #. later restart with the reused file descriptor. This is most likely a
337 #. serious programming error.
338 #. type: Plain text
339 #. #-#-#-#-# debian-unstable: close.2.pot (PACKAGE VERSION) #-#-#-#-#
340 #. Date: Tue, 4 Sep 2007 13:57:35 +0200
341 #. From: Fredrik Noring <[email protected]>
342 #. One such race involves signals and ERESTARTSYS. If a file descriptor
343 #. in use by a system call is closed and then reused by, e.g., an
344 #. independent open() in some unrelated thread, before the original system
345 #. call has restarted after ERESTARTSYS, the original system call will
346 #. later restart with the reused file descriptor. This is most likely a
347 #. serious programming error.
348 #. type: Plain text
349 #. #-#-#-#-# fedora-44: close.2.pot (PACKAGE VERSION) #-#-#-#-#
350 #. type: Plain text
351 #. #-#-#-#-# fedora-rawhide: close.2.pot (PACKAGE VERSION) #-#-#-#-#
352 #. type: Plain text
353 #. #-#-#-#-# mageia-cauldron: close.2.pot (PACKAGE VERSION) #-#-#-#-#
354 #. Date: Tue, 4 Sep 2007 13:57:35 +0200
355 #. From: Fredrik Noring <[email protected]>
356 #. One such race involves signals and ERESTARTSYS. If a file descriptor
357 #. in use by a system call is closed and then reused by, e.g., an
358 #. independent open() in some unrelated thread, before the original system
359 #. call has restarted after ERESTARTSYS, the original system call will
360 #. later restart with the reused file descriptor. This is most likely a
361 #. serious programming error.
362 #. type: Plain text
363 #. #-#-#-#-# opensuse-leap-16-1: close.2.pot (PACKAGE VERSION) #-#-#-#-#
364 #. Date: Tue, 4 Sep 2007 13:57:35 +0200
365 #. From: Fredrik Noring <[email protected]>
366 #. One such race involves signals and ERESTARTSYS. If a file descriptor
367 #. in use by a system call is closed and then reused by, e.g., an
368 #. independent open() in some unrelated thread, before the original system
369 #. call has restarted after ERESTARTSYS, the original system call will
370 #. later restart with the reused file descriptor. This is most likely a
371 #. serious programming error.
372 #. type: Plain text
373 #. #-#-#-#-# opensuse-tumbleweed: close.2.pot (PACKAGE VERSION) #-#-#-#-#
374 #. Date: Tue, 4 Sep 2007 13:57:35 +0200
375 #. From: Fredrik Noring <[email protected]>
376 #. One such race involves signals and ERESTARTSYS. If a file descriptor
377 #. in use by a system call is closed and then reused by, e.g., an
378 #. independent open() in some unrelated thread, before the original system
379 #. call has restarted after ERESTARTSYS, the original system call will
380 #. later restart with the reused file descriptor. This is most likely a
381 #. serious programming error.
382 #. type: Plain text
383 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
384 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
385 msgid ""
386 "It is probably unwise to close file descriptors while they may be in use by "
387 "system calls in other threads in the same process. Since a file descriptor "
388 "may be reused, there are some obscure race conditions that may cause "
389 "unintended side effects."
390 msgstr ""
391 "Вероятно неблагоразумно закрывать дескрипторы файла, в то время как они "
392 "могут использоваться системными вызовами других потоков того же процесса. "
393 "Поскольку файловый дескриптор может использоваться повторно, то существуют "
394 "некоторые неясные условия гонки, которые могут вызвать непреднамеренные "
395 "побочные эффекты."
396
397 #. type: Plain text
398 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
399 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
400 msgid ""
401 "Furthermore, consider the following scenario where two threads are "
402 "performing operations on the same file descriptor:"
403 msgstr ""
404 "Кроме того, рассмотрим следующий сценарий, в котором два потока выполняют "
405 "операции с одним и тем же файловым дескриптором:"
406
407 #. type: IP
408 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
409 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
410 #, no-wrap
411 msgid "(1)"
412 msgstr "(1)"
413
414 #. type: Plain text
415 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
416 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
417 msgid ""
418 "One thread is blocked in an I/O system call on the file descriptor. For "
419 "example, it is trying to B<write>(2) to a pipe that is already full, or "
420 "trying to B<read>(2) from a stream socket which currently has no available "
421 "data."
422 msgstr ""
423 "Один поток блокируется при системном вызове ввода-вывода для файлового "
424 "дескриптора. Например, он пытается выполнить B<write>(2) (запись) в канал, "
425 "который уже заполнен, или пытается выполнить B<read>(2) (чтение) из "
426 "потокового сокета, в котором в данный момент нет доступных данных."
427
428 #. type: IP
429 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
430 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
431 #, no-wrap
432 msgid "(2)"
433 msgstr "(2)"
434
435 #. type: Plain text
436 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
437 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
438 msgid "Another thread closes the file descriptor."
439 msgstr "Другой поток закрывает файловый дескриптор."
440
441 #. type: Plain text
442 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
443 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
444 msgid ""
445 "The behavior in this situation varies across systems. On some systems, when "
446 "the file descriptor is closed, the blocking system call returns immediately "
447 "with an error."
448 msgstr ""
449 "Поведение в этой ситуации различается в разных системах. В некоторых "
450 "системах, когда файловый дескриптор закрыт, системный вызов блокировки "
451 "немедленно возвращается с ошибкой."
452
453 #. 'struct file' in kernel-speak
454 #. type: Plain text
455 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
456 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
457 msgid ""
458 "On Linux (and possibly some other systems), the behavior is different: the "
459 "blocking I/O system call holds a reference to the underlying open file "
460 "description, and this reference keeps the description open until the I/O "
461 "system call completes. (See B<open>(2) for a discussion of open file "
462 "descriptions.) Thus, the blocking system call in the first thread may "
463 "successfully complete after the B<close>() in the second thread."
464 msgstr ""
465 "В Linux (и, возможно, в некоторых других системах) поведение иное: системный "
466 "вызов блокировки ввода-вывода содержит ссылку на дескриптор базового "
467 "открытого файла и эта ссылка сохраняет дескриптор открытым до завершения "
468 "системного вызова ввода-вывода (смотрите B<open>(2) для обсуждения открытого "
469 "файлового дескриптора). Таким образом, блокирующий системный вызов в первом "
470 "потоке может успешно завершиться после B<close>() во втором потоке."
471
472 #. type: SS
473 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
474 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
475 #, no-wrap
476 msgid "Dealing with error returns from close()"
477 msgstr "Обработка ошибки, возвращённой close()"
478
479 #. type: Plain text
480 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
481 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
482 msgid ""
483 "A careful programmer will check the return value of B<close>(), since it is "
484 "quite possible that errors on a previous B<write>(2) operation are reported "
485 "only on the final B<close>() that releases the open file description. "
486 "Failing to check the return value when closing a file may lead to I<silent> "
487 "loss of data. This can especially be observed with NFS and with disk quota."
488 msgstr ""
489 "Аккуратный программист всегда проверяет возвращаемое B<close>() значение, "
490 "так как очень вероятно, что об ошибках предыдущей операции B<write>(2) будет "
491 "сообщено только при последнем вызове B<close>(), который освобождает "
492 "дескриптор открытого файла. Невыполнение проверки возвращаемого значение при "
493 "закрытии файла может привести к I<silent> (неучтённой) потере данных. Это "
494 "особенно часто встречается с NFS и с дисковыми квотами."
495
496 #. type: Plain text
497 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
498 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
499 msgid ""
500 "Note, however, that a failure return should be used only for diagnostic "
501 "purposes (i.e., a warning to the application that there may still be I/O "
502 "pending or there may have been failed I/O) or remedial purposes (e.g., "
503 "writing the file once more or creating a backup)."
504 msgstr ""
505 "Однако заметим, что возвращаемая ошибка должна использоваться только для "
506 "диагностики (т. е. предупреждать приложение, что, возможно, есть "
507 "незаконченные операции ввода-вывода или произошла ошибка ввода-вывода) или "
508 "для исправления (например, повторной записи файла, или для создания "
509 "резервной копии)."
510
511 #. The file descriptor is released early in close();
512 #. close() ==> __close_fd():
513 #. __put_unused_fd() ==> __clear_open_fd()
514 #. return filp_close(file, files);
515 #. The errors are returned by filp_close() after the FD has been
516 #. cleared for re-use.
517 #. filp_close()
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 ""
522 "Retrying the B<close>() after a failure return is the wrong thing to do, "
523 "since this may cause a reused file descriptor from another thread to be "
524 "closed. This can occur because the Linux kernel I<always> releases the file "
525 "descriptor early in the close operation, freeing it for reuse; the steps "
526 "that may return an error, such as flushing data to the filesystem or device, "
527 "occur only later in the close operation."
528 msgstr ""
529 "Повторный вызов B<close>() после получения ошибки делать не стоит, так как "
530 "это может привести к закрытию повторно использованного файлового дескриптора "
531 "другого потока. Это может произойти из-за того, что ядро Linux I<always> "
532 "освобождает файловый дескриптор в самом начале операции закрытия, делая его "
533 "доступным для повторного использования. Шаги, которые могут вернуть ошибку, "
534 "такие как сброс данных в файловую систему или в устройство, происходят "
535 "только после операции закрытия."
536
537 #. FreeBSD documents this explicitly. From the look of the source code
538 #. SVR4, ancient SunOS, later Solaris, and AIX all do this.
539 #. type: Plain text
540 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
541 #: opensuse-tumbleweed
542 #, fuzzy
543 #| msgid ""
544 #| "Many other implementations similarly always close the file descriptor "
545 #| "(except in the case of B<EBADF>, meaning that the file descriptor was "
546 #| "invalid) even if they subsequently report an error on return from "
547 #| "B<close>(). POSIX.1 is currently silent on this point, but there are "
548 #| "plans to mandate this behavior in the next major release of the standard."
549 msgid ""
550 "Many other implementations similarly always close the file descriptor "
551 "(except in the case of B<EBADF>, meaning that the file descriptor was "
552 "invalid) even if they subsequently report an error on return from "
553 "B<close>(). POSIX.1-2008 was silent on this point."
554 msgstr ""
555 "Многие другие реализации поступают схожим образом и всегда закрывают "
556 "файловый дескриптор (за исключением случая B<EBADF>, означающего "
557 "некорректный файловый дескриптор) даже, если они затем возвратят ошибку "
558 "B<close>(). В POSIX.1 ничего не сказано на этот счёт, но есть планы "
559 "узаконить такое поведение в следующем выпуске стандарта."
560
561 #. type: Plain text
562 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
563 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
564 msgid ""
565 "A careful programmer who wants to know about I/O errors may precede "
566 "B<close>() with a call to B<fsync>(2)."
567 msgstr ""
568 "Аккуратный программист, который хочет узнать об ошибках ввода-вывода, перед "
569 "вызовом B<close>() вызовет B<fsync>(2)."
570
571 #. type: Plain text
572 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
573 #: opensuse-tumbleweed
574 #, fuzzy
575 #| msgid ""
576 #| "The B<EINTR> error is a somewhat special case. Regarding the B<EINTR> "
577 #| "error, POSIX.1-2008 says:"
578 msgid ""
579 "The B<EINTR> error is a somewhat special case. Regarding the B<EINTR> "
580 "error, POSIX.1-2008 said:"
581 msgstr ""
582 "Ошибка B<EINTR> является особым случаем. Об B<EINTR> в POSIX.1-2008 сказано:"
583
584 #. type: Plain text
585 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
586 #: opensuse-tumbleweed
587 #, fuzzy
588 #| msgid ""
589 #| "If B<close>() is interrupted by a signal that is to be caught, it shall "
590 #| "return -1 with I<errno> set to B<EINTR> and the state of I<fildes> is "
591 #| "unspecified."
592 msgid ""
593 "If B<close>() is interrupted by a signal that is to be caught, it shall "
594 "return -1 with I<errno> set to B<EINTR> and the state of I<fd> is "
595 "unspecified."
596 msgstr ""
597 "Если B<close>() прерван сигналом, который будет обработан, то вызов должен "
598 "вернуть -1, а I<errno> присвоить значение B<EINTR>; при этом состояние "
599 "I<fildes> не определено."
600
601 #. type: Plain text
602 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
603 #: opensuse-tumbleweed
604 #, fuzzy
605 #| msgid ""
606 #| "This permits the behavior that occurs on Linux and many other "
607 #| "implementations, where, as with other errors that may be reported by "
608 #| "B<close>(), the file descriptor is guaranteed to be closed. However, it "
609 #| "also permits another possibility: that the implementation returns an "
610 #| "B<EINTR> error and keeps the file descriptor open. (According to its "
611 #| "documentation, HP-UX's B<close>() does this.) The caller must then once "
612 #| "more use B<close>() to close the file descriptor, to avoid file "
613 #| "descriptor leaks. This divergence in implementation behaviors provides a "
614 #| "difficult hurdle for portable applications, since on many "
615 #| "implementations, B<close>() must not be called again after an B<EINTR> "
616 #| "error, and on at least one, B<close>() must be called again. There are "
617 #| "plans to address this conundrum for the next major release of the POSIX.1 "
618 #| "standard."
619 msgid ""
620 "This permits the behavior that occurs on Linux and many other "
621 "implementations, where, as with other errors that may be reported by "
622 "B<close>(), the file descriptor is guaranteed to be closed. However, it "
623 "also permits another possibility: that the implementation returns an "
624 "B<EINTR> error and keeps the file descriptor open. (According to its "
625 "documentation, HP-UX's B<close>() does this.) The caller must then once "
626 "more use B<close>() to close the file descriptor, to avoid file descriptor "
627 "leaks. This divergence in implementation behaviors provides a difficult "
628 "hurdle for portable applications, since on many implementations, B<close>() "
629 "must not be called again after an B<EINTR> error, and on at least one, "
630 "B<close>() must be called again."
631 msgstr ""
632 "Этим допускается режим работы, действующий в Linux и многих других "
633 "реализациях, где как и при других ошибках, которые может вернуть B<close>(), "
634 "файловый дескриптор гарантированно закрывается. Однако, это также допускает "
635 "и другой режим: реализация возвращает ошибку B<EINTR> и оставляет файловый "
636 "дескриптор открытым (согласно документации, так делает B<close>() в HP-UX). "
637 "Затем вызывающая сторона должна еще раз использовать B<close>(), чтобы "
638 "закрыть файловый дескриптор, чтобы избежать утечки файлового дескриптора. "
639 "Такое расхождение в поведении реализаций является сложным препятствием для "
640 "переносимых приложений, так как во многих реализациях B<close>() не должен "
641 "вызываться ещё раз после получения ошибки B<EINTR> и, по крайней мере, в "
642 "одном случае необходимо снова вызвать программу B<close>(). Есть планы "
643 "разгадать эту загадку в следующей большой версии стандарта POSIX.1."
644
645 #. type: Plain text
646 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
647 #: opensuse-tumbleweed
648 msgid ""
649 "POSIX.1-2024 standardized the behavior of HP-UX, making Linux and many other "
650 "implementations non-conforming. There are no plans to change the behavior "
651 "on Linux."
652 msgstr ""
653
654 #. type: SH
655 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
656 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
657 #, no-wrap
658 msgid "SEE ALSO"
659 msgstr "СМОТРИТЕ ТАКЖЕ"
660
661 #. type: Plain text
662 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
663 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
664 msgid ""
665 "B<close_range>(2), B<fcntl>(2), B<fsync>(2), B<open>(2), B<shutdown>(2), "
666 "B<unlink>(2), B<fclose>(3)"
667 msgstr ""
668 "B<close_range>(2), B<fcntl>(2), B<fsync>(2), B<open>(2), B<shutdown>(2), "
669 "B<unlink>(2), B<fclose>(3)"
670
671 #. type: TH
672 #: debian-trixie
673 #, no-wrap
674 msgid "2024-05-02"
675 msgstr "2 мая 2024 г."
676
677 #. type: TH
678 #: debian-trixie
679 #, no-wrap
680 msgid "Linux man-pages 6.9.1"
681 msgstr "Страницы руководства Linux 6.9.1"
682
683 #. type: Plain text
684 #: debian-trixie
685 msgid "Standard C library (I<libc>, I<-lc>)"
686 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
687
688 #. type: Plain text
689 #: debian-trixie fedora-44 fedora-rawhide
690 msgid ""
691 "See NOTES for a discussion of why B<close>() should not be retried after an "
692 "error."
693 msgstr ""
694 "Смотрите ПРИМЕЧАНИЯ к обсуждению почему B<close>() нельзя вызывать снова "
695 "после ошибки."
696
697 #. SVr4 documents an additional ENOLINK error condition.
698 #. type: Plain text
699 #: debian-trixie fedora-44 fedora-rawhide
700 msgid "POSIX.1-2001, SVr4, 4.3BSD."
701 msgstr "POSIX.1-2001, SVr4, 4.3BSD."
702
703 #. FreeBSD documents this explicitly. From the look of the source code
704 #. SVR4, ancient SunOS, later Solaris, and AIX all do this.
705 #. Issue 8
706 #. type: Plain text
707 #: debian-trixie fedora-44 fedora-rawhide
708 msgid ""
709 "Many other implementations similarly always close the file descriptor "
710 "(except in the case of B<EBADF>, meaning that the file descriptor was "
711 "invalid) even if they subsequently report an error on return from "
712 "B<close>(). POSIX.1 is currently silent on this point, but there are plans "
713 "to mandate this behavior in the next major release of the standard."
714 msgstr ""
715 "Многие другие реализации поступают схожим образом и всегда закрывают "
716 "файловый дескриптор (за исключением случая B<EBADF>, означающего "
717 "некорректный файловый дескриптор) даже, если они затем возвратят ошибку "
718 "B<close>(). В POSIX.1 ничего не сказано на этот счёт, но есть планы "
719 "узаконить такое поведение в следующем выпуске стандарта."
720
721 #. type: Plain text
722 #: debian-trixie fedora-44 fedora-rawhide
723 msgid ""
724 "The B<EINTR> error is a somewhat special case. Regarding the B<EINTR> "
725 "error, POSIX.1-2008 says:"
726 msgstr ""
727 "Ошибка B<EINTR> является особым случаем. Об B<EINTR> в POSIX.1-2008 сказано:"
728
729 #. type: Plain text
730 #: debian-trixie fedora-44 fedora-rawhide
731 msgid ""
732 "If B<close>() is interrupted by a signal that is to be caught, it shall "
733 "return -1 with I<errno> set to B<EINTR> and the state of I<fildes> is "
734 "unspecified."
735 msgstr ""
736 "Если B<close>() прерван сигналом, который будет обработан, то вызов должен "
737 "вернуть -1, а I<errno> присвоить значение B<EINTR>; при этом состояние "
738 "I<fildes> не определено."
739
740 #. FIXME . for later review when Issue 8 is one day released...
741 #. POSIX proposes further changes for EINTR
742 #. http://austingroupbugs.net/tag_view_page.php?tag_id=8
743 #. http://austingroupbugs.net/view.php?id=529
744 #. FIXME .
745 #. Review the following glibc bug later
746 #. https://sourceware.org/bugzilla/show_bug.cgi?id=14627
747 #. type: Plain text
748 #: debian-trixie fedora-44 fedora-rawhide
749 msgid ""
750 "This permits the behavior that occurs on Linux and many other "
751 "implementations, where, as with other errors that may be reported by "
752 "B<close>(), the file descriptor is guaranteed to be closed. However, it "
753 "also permits another possibility: that the implementation returns an "
754 "B<EINTR> error and keeps the file descriptor open. (According to its "
755 "documentation, HP-UX's B<close>() does this.) The caller must then once "
756 "more use B<close>() to close the file descriptor, to avoid file descriptor "
757 "leaks. This divergence in implementation behaviors provides a difficult "
758 "hurdle for portable applications, since on many implementations, B<close>() "
759 "must not be called again after an B<EINTR> error, and on at least one, "
760 "B<close>() must be called again. There are plans to address this conundrum "
761 "for the next major release of the POSIX.1 standard."
762 msgstr ""
763 "Этим допускается режим работы, действующий в Linux и многих других "
764 "реализациях, где как и при других ошибках, которые может вернуть B<close>(), "
765 "файловый дескриптор гарантированно закрывается. Однако, это также допускает "
766 "и другой режим: реализация возвращает ошибку B<EINTR> и оставляет файловый "
767 "дескриптор открытым (согласно документации, так делает B<close>() в HP-UX). "
768 "Затем вызывающая сторона должна еще раз использовать B<close>(), чтобы "
769 "закрыть файловый дескриптор, чтобы избежать утечки файлового дескриптора. "
770 "Такое расхождение в поведении реализаций является сложным препятствием для "
771 "переносимых приложений, так как во многих реализациях B<close>() не должен "
772 "вызываться ещё раз после получения ошибки B<EINTR> и, по крайней мере, в "
773 "одном случае необходимо снова вызвать программу B<close>(). Есть планы "
774 "разгадать эту загадку в следующей большой версии стандарта POSIX.1."
775
776 #. type: TH
777 #: fedora-44 fedora-rawhide
778 #, no-wrap
779 msgid "2024-07-23"
780 msgstr "23 июля 2024 г."
781
782 #. type: TH
783 #: fedora-44 fedora-rawhide
784 #, no-wrap
785 msgid "Linux man-pages 6.13"
786 msgstr "Страницы руководства Linux 6.13"
787
788 #. Date: Tue, 4 Sep 2007 13:57:35 +0200
789 #. From: Fredrik Noring <[email protected]>
790 #. One such race involves signals and ERESTARTSYS. If a file descriptor
791 #. in use by a system call is closed and then reused by e.g. an
792 #. independent open() in some unrelated thread, before the original system
793 #. call has restarted after ERESTARTSYS, the original system call will
794 #. later restart with the reused file descriptor. This is most likely a
795 #. serious programming error.
796 #. type: Plain text
797 #: fedora-44 fedora-rawhide
798 msgid ""
799 "When dealing with sockets, you have to be sure that there is no B<recv>(2) "
800 "still blocking on it on another thread, otherwise it might block forever, "
801 "since no more messages will be send via the socket. Be sure to use "
802 "B<shutdown>(2) to shut down all parts the connection before closing the "
803 "socket."
804 msgstr ""
805 "Когда вы имеете дело с сокетами, вы должны быть уверены, что в другом потоке "
806 "нет B<recv>(2), который все еще блокирует его, иначе он может быть "
807 "заблокирован навсегда, так как больше никаких сообщений через сокет "
808 "отправляться не будет. Обязательно используйте клавишу B<shutdown>(2), чтобы "
809 "отключить все части соединения, прежде чем закрывать сокет."
810
811 #. type: TH
812 #: mageia-cauldron
813 #, no-wrap
814 msgid "Linux man-pages 6.17"
815 msgstr "Страницы руководства Linux 6.17"
816
817 #. type: TH
818 #: opensuse-leap-16-1 opensuse-tumbleweed
819 #, no-wrap
820 msgid "Linux man-pages (unreleased)"
821 msgstr "Страницы руководства Linux (не выпущены)"