summaryrefslogtreecommitdiffstats
path: root/po/ru/man2/open_by_handle_at.2.po
blob: 3676ff935674382a0afc3104285ef51f8886099c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
# Russian translation of manpages
# This file is distributed under the same license as the manpages-l10n package.
# Copyright © of this file:
# Azamat Hackimov <azamat.hackimov@gmail.com>, 2016.
# Konstantin Shvaykovskiy <kot.shv@gmail.com>, 2012.
# Yuri Kozlov <yuray@komyakino.ru>, 2011-2019.
# Иван Павлов <pavia00@gmail.com>, 2017.
msgid ""
msgstr ""
"Project-Id-Version: manpages-l10n\n"
"POT-Creation-Date: 2024-06-01 06:07+0200\n"
"PO-Revision-Date: 2019-10-06 09:05+0300\n"
"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
"Language-Team: Russian <man-pages-ru-talks@lists.sourceforge.net>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
"%100>=11 && n%100<=14)? 2 : 3);\n"
"X-Generator: Lokalize 2.0\n"

#. type: TH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "open_by_handle_at"
msgstr "open_by_handle_at"

#. type: TH
#: archlinux debian-unstable opensuse-tumbleweed
#, no-wrap
msgid "2024-05-02"
msgstr "2 мая 2024 г."

#. type: TH
#: archlinux debian-unstable
#, fuzzy, no-wrap
#| msgid "Linux man-pages 6.7"
msgid "Linux man-pages 6.8"
msgstr "Linux man-pages 6.7"

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "NAME"
msgstr "ИМЯ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"name_to_handle_at, open_by_handle_at - obtain handle for a pathname and open "
"file via a handle"
msgstr ""
"name_to_handle_at, open_by_handle_at - получение описателя для пути и "
"открытие файла через описатель"

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "LIBRARY"
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "Standard C library (I<libc>, I<-lc>)"
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "SYNOPSIS"
msgstr "СИНТАКСИС"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
"B<#include E<lt>fcntl.hE<gt>>\n"
msgstr ""
"B<#define _GNU_SOURCE>         /* см. feature_test_macros(7) */\n"
"B<#include E<lt>fcntl.hE<gt>>\n"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, fuzzy, no-wrap
#| msgid ""
#| "B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n"
#| "B<                      struct file_handle *>I<handle>B<,>\n"
#| "B<                      int *>I<mount_id>B<, int >I<flags>B<);>\n"
msgid ""
"B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n"
"B<                      struct file_handle *>I<handle>B<,>\n"
"B<                      int *>I<mount_id>B<, int >I<flags>B<);>\n"
"B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n"
"B<                      int >I<flags>B<);>\n"
msgstr ""
"B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n"
"B<                      struct file_handle *>I<handle>B<,>\n"
"B<                      int *>I<mount_id>B<, int >I<flags>B<);>\n"

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "DESCRIPTION"
msgstr "ОПИСАНИЕ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<name_to_handle_at>()  and B<open_by_handle_at>()  system calls split "
"the functionality of B<openat>(2)  into two parts: B<name_to_handle_at>()  "
"returns an opaque handle that corresponds to a specified file; "
"B<open_by_handle_at>()  opens the file corresponding to a handle returned by "
"a previous call to B<name_to_handle_at>()  and returns an open file "
"descriptor."
msgstr ""
"Функциональное назначение B<openat>(2) было разделено на две части и "
"добавлено в системные вызовы B<name_to_handle_at>() и "
"B<open_by_handle_at>(): B<name_to_handle_at>() возвращает  описатель с "
"произвольной формой(opaque), который соответствует указанному файлу; "
"B<open_by_handle_at>() открывает файл по описателю, который был возвращён "
"предыдущим вызовом B<name_to_handle_at>() и возвращает дескриптор открытого "
"файла."

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "name_to_handle_at()"
msgstr "name_to_handle_at()"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<name_to_handle_at>()  system call returns a file handle and a mount ID "
"corresponding to the file specified by the I<dirfd> and I<pathname> "
"arguments.  The file handle is returned via the argument I<handle>, which is "
"a pointer to a structure of the following form:"
msgstr ""
"Системный вызов B<name_to_handle_at>() возвращает файловый описатель и "
"идентификатор монтирования для файла, указанного в аргументах I<dirfd> и "
"I<pathname>. Файловый описатель возвращается через аргумент I<handle>, "
"который является указателем на следующую структуру:"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid ""
"struct file_handle {\n"
"    unsigned int  handle_bytes;   /* Size of f_handle [in, out] */\n"
"    int           handle_type;    /* Handle type [out] */\n"
"    unsigned char f_handle[0];    /* File identifier (sized by\n"
"                                     caller) [out] */\n"
"};\n"
msgstr ""
"struct file_handle {\n"
"    unsigned int  handle_bytes;   /* размер f_handle [in, out] */\n"
"    int           handle_type;    /* тип описателя [out] */\n"
"    unsigned char f_handle[0];    /* идентификатор файла (размер\n"
"                                     задаёт вызывающий) [out] */\n"
"};\n"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"It is the caller's responsibility to allocate the structure with a size "
"large enough to hold the handle returned in I<f_handle>.  Before the call, "
"the I<handle_bytes> field should be initialized to contain the allocated "
"size for I<f_handle>.  (The constant B<MAX_HANDLE_SZ>, defined in "
"I<E<lt>fcntl.hE<gt>>, specifies the maximum expected size for a file "
"handle.  It is not a guaranteed upper limit as future filesystems may "
"require more space.)  Upon successful return, the I<handle_bytes> field is "
"updated to contain the number of bytes actually written to I<f_handle>."
msgstr ""
"Вызывающий должен выделить память достаточного размера под структуру "
"описателя, возвращаемого в I<f_handle>. Перед вызовом поле I<handle_bytes> "
"должно содержать размер выделенной памяти для I<f_handle> (константа "
"B<MAX_HANDLE_SZ>, определённая в I<E<lt>fcntl.hE<gt>>, равна максимально "
"ожидаемому размеру описателя файла. Это не гарантированное верхнее "
"ограничение, так как файловые системы в будущем могут потребовать больше "
"места). При успешном выполнении поле I<handle_bytes> обновляется и содержит "
"количество байт действительно занятых под I<f_handle>."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The caller can discover the required size for the I<file_handle> structure "
"by making a call in which I<handle-E<gt>handle_bytes> is zero; in this case, "
"the call fails with the error B<EOVERFLOW> and I<handle-E<gt>handle_bytes> "
"is set to indicate the required size; the caller can then use this "
"information to allocate a structure of the correct size (see EXAMPLES "
"below).  Some care is needed here as B<EOVERFLOW> can also indicate that no "
"file handle is available for this particular name in a filesystem which does "
"normally support file-handle lookup.  This case can be detected when the "
"B<EOVERFLOW> error is returned without I<handle_bytes> being increased."
msgstr ""
"Вызывающий может определить требуемый размер структуры I<file_handle> указав "
"при вызове значение I<handle-E<gt>handle_bytes> равное нулю; в этому случае "
"вызов завершается с ошибкой B<EOVERFLOW>, а в поле I<handle-"
"E<gt>handle_bytes> записывается требуемый размер; затем вызывающий может "
"использовать эту информацию для выделения памяти под структуру правильного "
"размера (смотрите ПРИМЕРЫ ниже). Здесь нужно учесть, что B<EOVERFLOW> может "
"указывать на то, что файловый описатель недоступен для этого заданного имени "
"в файловой системе, которая, обычно, поддерживает поиск файловых описателей. "
"На данный случай указывает то, что ошибка B<EOVERFLOW> возвращается без "
"увеличившегося значения I<handle_bytes>."

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
msgid ""
"Other than the use of the I<handle_bytes> field, the caller should treat the "
"I<file_handle> structure as an opaque data type: the I<handle_type> and "
"I<f_handle> fields can be used in a subsequent call to "
"B<open_by_handle_at>().  The caller can also use the opaque I<file_handle> "
"to compare the identity of filesystem objects that were queried at different "
"times and possibly at different paths.  The B<fanotify>(7)  subsystem can "
"report events with an information record containing a I<file_handle> to "
"identify the filesystem object."
msgstr ""

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, fuzzy
#| msgid ""
#| "The I<flags> argument is a bit mask constructed by ORing together zero or "
#| "more of B<AT_EMPTY_PATH> and B<AT_SYMLINK_FOLLOW>, described below."
msgid ""
"The I<flags> argument is a bit mask constructed by ORing together zero or "
"more of B<AT_HANDLE_FID>, B<AT_EMPTY_PATH>, and B<AT_SYMLINK_FOLLOW>, "
"described below."
msgstr ""
"Аргумент I<flags> представляет собой битовую маску (OR) из комбинации нуля "
"или более флагов B<AT_EMPTY_PATH> и B<AT_SYMLINK_FOLLOW>, описанных ниже."

#.  commit 96b2b072ee62be8ae68c8ecf14854c4d0505a8f8
#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
msgid ""
"When I<flags> contain the B<AT_HANDLE_FID> (since Linux 6.5)  flag, the "
"caller indicates that the returned I<file_handle> is needed to identify the "
"filesystem object, and not for opening the file later, so it should be "
"expected that a subsequent call to B<open_by_handle_at>()  with the returned "
"I<file_handle> may fail."
msgstr ""

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Together, the I<pathname> and I<dirfd> arguments identify the file for which "
"a handle is to be obtained.  There are four distinct cases:"
msgstr ""
"Аргументы I<pathname> и I<dirfd> вместе задают файл, для которого будет "
"получен описатель. Есть четыре различных варианта:"

#. type: IP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "\\[bu]"
msgstr "\\[bu]"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If I<pathname> is a nonempty string containing an absolute pathname, then a "
"handle is returned for the file referred to by that pathname.  In this case, "
"I<dirfd> is ignored."
msgstr ""
"Если значение I<pathname> — непустая строка, содержащая абсолютный путь, то "
"описатель возвращается для файла, на который указывает путь. В этом случае "
"I<dirfd> игнорируется."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If I<pathname> is a nonempty string containing a relative pathname and "
"I<dirfd> has the special value B<AT_FDCWD>, then I<pathname> is interpreted "
"relative to the current working directory of the caller, and a handle is "
"returned for the file to which it refers."
msgstr ""
"Если значение I<pathname> — непустая строка, содержащая относительный путь и "
"I<dirfd> равно специальному значению B<AT_FDCWD>, то I<pathname> "
"рассматривается относительно текущего рабочего каталога вызывающего и "
"описатель возвращается для файла, на который он указывает."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If I<pathname> is a nonempty string containing a relative pathname and "
"I<dirfd> is a file descriptor referring to a directory, then I<pathname> is "
"interpreted relative to the directory referred to by I<dirfd>, and a handle "
"is returned for the file to which it refers.  (See B<openat>(2)  for an "
"explanation of why \"directory file descriptors\" are useful.)"
msgstr ""
"Если значение I<pathname> — непустая строка, содержащая относительный путь и "
"I<dirfd> равно файловому дескриптору, указывающему на каталог, то "
"I<pathname> рассматривается относительно каталога, на который указывает "
"I<dirfd>, и описатель возвращается для файла, на который он указывает "
"(смотрите в B<openat>(2) объяснение полезности «файловых дескрипторов "
"каталогов»)."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If I<pathname> is an empty string and I<flags> specifies the value "
"B<AT_EMPTY_PATH>, then I<dirfd> can be an open file descriptor referring to "
"any type of file, or B<AT_FDCWD>, meaning the current working directory, and "
"a handle is returned for the file to which it refers."
msgstr ""
"Если значение I<pathname> — пустая строка и значение I<flags> равно "
"B<AT_EMPTY_PATH>, то I<dirfd> может быть открытым файловым дескриптором, "
"указывающим на файл любого типа, или B<AT_FDCWD>, означающим текущий рабочий "
"каталог, и описатель возвращается для файла, на который он указывает."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The I<mount_id> argument returns an identifier for the filesystem mount that "
"corresponds to I<pathname>.  This corresponds to the first field in one of "
"the records in I</proc/self/mountinfo>.  Opening the pathname in the fifth "
"field of that record yields a file descriptor for the mount point; that file "
"descriptor can be used in a subsequent call to B<open_by_handle_at>().  "
"I<mount_id> is returned both for a successful call and for a call that "
"results in the error B<EOVERFLOW>."
msgstr ""
"В аргументе I<mount_id> возвращается идентификатор точки монтирования в "
"файловой системе, соответствующий I<pathname>. Это значение соответствует "
"первому полю одной из записей в I</proc/self/mountinfo>. Открытие пути из "
"пятого поля этой записи возвращает файловый дескриптор этой точки "
"монтирования; этот файловый дескриптор можно использовать в последующем "
"вызове B<open_by_handle_at>(). Аргумент I<mount_id> возвращается при "
"успешном выполнении, а также при ошибке B<EOVERFLOW>()."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"By default, B<name_to_handle_at>()  does not dereference I<pathname> if it "
"is a symbolic link, and thus returns a handle for the link itself.  If "
"B<AT_SYMLINK_FOLLOW> is specified in I<flags>, I<pathname> is dereferenced "
"if it is a symbolic link (so that the call returns a handle for the file "
"referred to by the link)."
msgstr ""
"По умолчанию, B<name_to_handle_at>() не разыменовывает I<pathname>, если это "
"символическая ссылка, и поэтому возвращается описатель самой ссылки. Если в "
"I<flags> указан B<AT_SYMLINK_FOLLOW>, то I<pathname> разыменовывается, если "
"это символическая ссылка (то есть вызов возвращает описатель файла, на "
"который указывает ссылка)."

#.  commit 20fa19027286983ab2734b5910c4a687436e0c31
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"B<name_to_handle_at>()  does not trigger a mount when the final component of "
"the pathname is an automount point.  When a filesystem supports both file "
"handles and automount points, a B<name_to_handle_at>()  call on an automount "
"point will return with error B<EOVERFLOW> without having increased "
"I<handle_bytes>.  This can happen since Linux 4.13 with NFS when accessing a "
"directory which is on a separate filesystem on the server.  In this case, "
"the automount can be triggered by adding a \"/\" to the end of the pathname."
msgstr ""
"Системный вызов B<name_to_handle_at>() не вызывает монтирования, если "
"конечная часть пути является автоматической точкой монтирования. Если "
"файловая система поддерживает файловые описатели и автоматические точки "
"монтирования, то вызов B<name_to_handle_at>() для автоматической точки "
"монтирования завершится ошибкой B<EOVERFLOW> без увеличения значения "
"I<handle_bytes>. Это может происходить с NFS начиная с версии Linux 4.13, "
"когда задействованный каталог находится в отдельной файловой системе на "
"сервере. В этом случае автомонтирование можно получить добавлением «/» в "
"конец пути."

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "open_by_handle_at()"
msgstr "open_by_handle_at()"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The B<open_by_handle_at>()  system call opens the file referred to by "
"I<handle>, a file handle returned by a previous call to "
"B<name_to_handle_at>()."
msgstr ""
"Системный вызов B<open_by_handle_at>() открывает файл, на который указывает "
"I<handle>, файловый описатель, полученный от предшествующего вызова "
"B<name_to_handle_at>()."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The I<mount_fd> argument is a file descriptor for any object (file, "
"directory, etc.)  in the mounted filesystem with respect to which I<handle> "
"should be interpreted.  The special value B<AT_FDCWD> can be specified, "
"meaning the current working directory of the caller."
msgstr ""
"Аргумент I<mount_fd> — это файловый дескриптор любого объекта (файла, "
"каталога и т. д.) в смонтированной файловой системе, в которой должен "
"находиться I<handle>. Может быть равен специальному значению B<AT_FDCWD>, "
"которое обозначает текущий рабочий каталог вызывающего."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The I<flags> argument is as for B<open>(2).  If I<handle> refers to a "
"symbolic link, the caller must specify the B<O_PATH> flag, and the symbolic "
"link is not dereferenced; the B<O_NOFOLLOW> flag, if specified, is ignored."
msgstr ""
"Значение аргумента I<flags> как у B<open>(2). Если I<handle> указывает на "
"символическую ссылку, то вызывающий должен указать флаг B<O_PATH>, и "
"символическая ссылка не разыменовывается; флаг B<O_NOFOLLOW> игнорируется."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The caller must have the B<CAP_DAC_READ_SEARCH> capability to invoke "
"B<open_by_handle_at>()."
msgstr ""
"Для вызова B<open_by_handle_at>() вызывающий должен иметь мандат "
"B<CAP_DAC_READ_SEARCH>."

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "RETURN VALUE"
msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, fuzzy
#| msgid ""
#| "On success, B<name_to_handle_at>()  returns 0, and "
#| "B<open_by_handle_at>()  returns a nonnegative file descriptor."
msgid ""
"On success, B<name_to_handle_at>()  returns 0, and B<open_by_handle_at>()  "
"returns a file descriptor (a nonnegative integer)."
msgstr ""
"При успешном выполнении B<name_to_handle_at>() возвращает 0, а "
"B<open_by_handle_at>() возвращает неотрицательный файловый дескриптор."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, fuzzy
#| msgid ""
#| "In the event of an error, both system calls return -1 and set I<errno> to "
#| "indicate the cause of the error."
msgid ""
"In the event of an error, both system calls return -1 and set I<errno> to "
"indicate the error."
msgstr ""
"В случае ошибки системные вызовы возвращают -1, а в I<errno> записывается "
"код ошибки."

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "ERRORS"
msgstr "ОШИБКИ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"B<name_to_handle_at>()  and B<open_by_handle_at>()  can fail for the same "
"errors as B<openat>(2).  In addition, they can fail with the errors noted "
"below."
msgstr ""
"Вызовы B<name_to_handle_at>() и B<open_by_handle_at>() могут завершиться с "
"теми же ошибками что и B<openat>(2). Также могут возникать следующие ошибки:"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "B<name_to_handle_at>()  can fail with the following errors:"
msgstr "Вызов B<name_to_handle_at>() может завершиться со следующими ошибками:"

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EFAULT>"
msgstr "B<EFAULT>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<pathname>, I<mount_id>, or I<handle> points outside your accessible "
"address space."
msgstr ""
"Значение I<pathname>, I<mount_id> или I<handle> указывает за пределы "
"доступного адресного пространства."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EINVAL>"
msgstr "B<EINVAL>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "I<flags> includes an invalid bit value."
msgstr "Значение I<flags> содержит некорректно установленный бит."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "I<handle-E<gt>handle_bytes> is greater than B<MAX_HANDLE_SZ>."
msgstr "Значение I<handle-E<gt>handle_bytes> больше B<MAX_HANDLE_SZ>."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<ENOENT>"
msgstr "B<ENOENT>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<pathname> is an empty string, but B<AT_EMPTY_PATH> was not specified in "
"I<flags>."
msgstr ""
"Значение I<pathname> равно пустой строке, но в I<flags> не указано значение "
"B<AT_EMPTY_PATH>."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<ENOTDIR>"
msgstr "B<ENOTDIR>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The file descriptor supplied in I<dirfd> does not refer to a directory, and "
"it is not the case that both I<flags> includes B<AT_EMPTY_PATH> and "
"I<pathname> is an empty string."
msgstr ""
"Файловый дескриптор, указанный в I<dirfd>, не ссылается на каталог и это не "
"тот случай, когда I<flags> содержит B<AT_EMPTY_PATH> и I<pathname> равно "
"пустой строке."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EOPNOTSUPP>"
msgstr "B<EOPNOTSUPP>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The filesystem does not support decoding of a pathname to a file handle."
msgstr ""
"Файловая система не поддерживает преобразование пути в файловый описатель."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EOVERFLOW>"
msgstr "B<EOVERFLOW>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The I<handle-E<gt>handle_bytes> value passed into the call was too small.  "
"When this error occurs, I<handle-E<gt>handle_bytes> is updated to indicate "
"the required size for the handle."
msgstr ""
"Значение I<handle-E<gt>handle_bytes>, переданное в вызов, слишком мало. При "
"этой ошибке I<handle-E<gt>handle_bytes> присваивается требуемый размер для "
"описателя."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "B<open_by_handle_at>()  can fail with the following errors:"
msgstr "Вызов B<open_by_handle_at>() может завершиться со следующими ошибками:"

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EBADF>"
msgstr "B<EBADF>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "I<mount_fd> is not an open file descriptor."
msgstr "Значение I<mount_fd> не является открытым файловым дескриптором."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<pathname> is relative but I<dirfd> is neither B<AT_FDCWD> nor a valid file "
"descriptor."
msgstr ""
"В I<pathname> содержится относительный путь, но значение I<dirfd> не равно "
"B<AT_FDCWD> и не является правильным файловым дескриптором."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "I<handle> points outside your accessible address space."
msgstr ""
"Значение I<handle> указывает за пределы доступного адресного пространства."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<handle-E<gt>handle_bytes> is greater than B<MAX_HANDLE_SZ> or is equal to "
"zero."
msgstr ""
"Значение I<handle-E<gt>handle_bytes> больше B<MAX_HANDLE_SZ> или равно нулю."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<ELOOP>"
msgstr "B<ELOOP>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"I<handle> refers to a symbolic link, but B<O_PATH> was not specified in "
"I<flags>."
msgstr ""
"Значение I<handle> указывает на символическую ссылку, но в I<flags> не "
"указан B<O_PATH>."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<EPERM>"
msgstr "B<EPERM>"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The caller does not have the B<CAP_DAC_READ_SEARCH> capability."
msgstr "Вызывающий не имеет мандата B<CAP_DAC_READ_SEARCH>."

#. type: TP
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "B<ESTALE>"
msgstr "B<ESTALE>"

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
msgid ""
"The specified I<handle> is not valid for opening a file.  This error will "
"occur if, for example, the file has been deleted.  This error can also occur "
"if the I<handle> was acquired using the B<AT_HANDLE_FID> flag and the "
"filesystem does not support B<open_by_handle_at>()."
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "VERSIONS"
msgstr "ВЕРСИИ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"FreeBSD has a broadly similar pair of system calls in the form of "
"B<getfh>()  and B<openfh>()."
msgstr ""
"В FreeBSD есть относительно похожая пара системных вызовов B<getfh>() и "
"B<openfh>()."

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "STANDARDS"
msgstr "СТАНДАРТЫ"

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-leap-15-6 opensuse-tumbleweed
msgid "Linux."
msgstr "Linux."

#. type: SH
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "HISTORY"
msgstr "ИСТОРИЯ"

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-leap-15-6 opensuse-tumbleweed
msgid "Linux 2.6.39, glibc 2.14."
msgstr ""

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "NOTES"
msgstr "ПРИМЕЧАНИЯ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"A file handle can be generated in one process using B<name_to_handle_at>()  "
"and later used in a different process that calls B<open_by_handle_at>()."
msgstr ""
"Файловый описатель может быть сгенерирован с помощью B<name_to_handle_at>() "
"в одном процессе и использован в вызовах B<open_by_handle_at>() в другом."

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, fuzzy
#| msgid ""
#| "Some filesystem don't support the translation of pathnames to file "
#| "handles, for example, I</proc>, I</sys>, and various network filesystems."
msgid ""
"Some filesystem don't support the translation of pathnames to file handles, "
"for example, I</proc>, I</sys>, and various network filesystems.  Some "
"filesystems support the translation of pathnames to file handles, but do not "
"support using those file handles in B<open_by_handle_at>()."
msgstr ""
"Некоторые файловые системы не поддерживают трансляцию путей в файловые "
"описатели, например: I</proc>, I</sys> и различные сетевые файловые системы."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"A file handle may become invalid (\"stale\") if a file is deleted, or for "
"other filesystem-specific reasons.  Invalid handles are notified by an "
"B<ESTALE> error from B<open_by_handle_at>()."
msgstr ""
"Файловый описатель может стать некорректным («просроченным»), если файл "
"удалён, или по другим причинам, относящимся к файловой системе. Для "
"некорректных описателей B<open_by_handle_at>() возвращает ошибку B<ESTALE>."

#.  https://lwn.net/Articles/375888/
#. 	"Open by handle" - Jonathan Corbet, 2010-02-23
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"These system calls are designed for use by user-space file servers.  For "
"example, a user-space NFS server might generate a file handle and pass it to "
"an NFS client.  Later, when the client wants to open the file, it could pass "
"the handle back to the server.  This sort of functionality allows a user-"
"space file server to operate in a stateless fashion with respect to the "
"files it serves."
msgstr ""
"Данные системные вызовы предназначены для использования в файловых серверах "
"пространства пользователя. Например, сервер пользовательского пространства "
"NFS может генерировать файловый описатель и передавать его клиенту NFS. "
"Позднее, когда клиент захочет открыть файл, он может передать описатель "
"обратно серверу. Такого рода возможность позволяет файловому серверу "
"пространства пользователя работать без формирования состояния (stateless "
"fashion) для файлов, которые они обслуживают."

#.  commit bcda76524cd1fa32af748536f27f674a13e56700
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"If I<pathname> refers to a symbolic link and I<flags> does not specify "
"B<AT_SYMLINK_FOLLOW>, then B<name_to_handle_at>()  returns a handle for the "
"link (rather than the file to which it refers).  The process receiving the "
"handle can later perform operations on the symbolic link by converting the "
"handle to a file descriptor using B<open_by_handle_at>()  with the B<O_PATH> "
"flag, and then passing the file descriptor as the I<dirfd> argument in "
"system calls such as B<readlinkat>(2)  and B<fchownat>(2)."
msgstr ""
"Если I<pathname> указывает на символическую ссылку и в I<flags> отсутствует "
"B<AT_SYMLINK_FOLLOW>, то B<name_to_handle_at>() возвращает описатель ссылки "
"(а не файла, на который она ссылается). Процесс, получивший описатель, может "
"позднее выполнить операции над символической ссылкой, преобразовав описатель "
"в файловый дескриптор, используя B<open_by_handle_at>() с флагом B<O_PATH>, "
"и затем передав файловый дескриптор через аргумент I<dirfd> в системные "
"вызовы B<readlinkat>(2) и B<fchownat>(2)."

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "Obtaining a persistent filesystem ID"
msgstr "Получение постоянного идентификатора файловой системы"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The mount IDs in I</proc/self/mountinfo> can be reused as filesystems are "
"unmounted and mounted.  Therefore, the mount ID returned by "
"B<name_to_handle_at>()  (in I<*mount_id>)  should not be treated as a "
"persistent identifier for the corresponding mounted filesystem.  However, an "
"application can use the information in the I<mountinfo> record that "
"corresponds to the mount ID to derive a persistent identifier."
msgstr ""
"Идентификаторы монтирования в I</proc/self/mountinfo> могут быть "
"использованы повторно после размонтирования и монтирования файловой системы. "
"Поэтому, идентификатор монтирования, возвращаемый B<name_to_handle_at>() (в "
"I<*mount_id>), не должен считаться постоянным идентификатором "
"соответствующей файловой системы. Однако, приложение может использовать "
"информацию в записи I<mountinfo>, которая соответствует идентификатору "
"монтирования, для получения постоянного идентификатора."

#.  e.g., http://stackoverflow.com/questions/6748429/using-libblkid-to-find-uuid-of-a-partition
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"For example, one can use the device name in the fifth field of the "
"I<mountinfo> record to search for the corresponding device UUID via the "
"symbolic links in I</dev/disks/by-uuid>.  (A more comfortable way of "
"obtaining the UUID is to use the B<libblkid>(3)  library.)  That process can "
"then be reversed, using the UUID to look up the device name, and then "
"obtaining the corresponding mount point, in order to produce the I<mount_fd> "
"argument used by B<open_by_handle_at>()."
msgstr ""
"Например, можно использовать имя устройства в пятом поле записи I<mountinfo> "
"для поиска соответствующего устройству UUID через символические ссылки в I</"
"dev/disks/by-uuid> (более удобный способ получения UUID — использовать "
"библиотеку B<libblkid>(3)). Этот процесс может быть и обратным — используя "
"UUID найти имя устройства, и затем получить соответствующую точку "
"монтирования, чтобы создать аргумент I<mount_fd>, используемый для "
"B<open_by_handle_at>()."

#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "EXAMPLES"
msgstr "ПРИМЕРЫ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The two programs below demonstrate the use of B<name_to_handle_at>()  and "
"B<open_by_handle_at>().  The first program (I<t_name_to_handle_at.c>)  uses "
"B<name_to_handle_at>()  to obtain the file handle and mount ID for the file "
"specified in its command-line argument; the handle and mount ID are written "
"to standard output."
msgstr ""
"Две представленные далее программы демонстрируют использование "
"B<name_to_handle_at>() и B<open_by_handle_at>(). Первая программа "
"(I<t_name_to_handle_at.c>) использует B<name_to_handle_at>() для получения "
"файлового описателя и идентификатора монтирования для файла, указанного в "
"аргументе командной строки; описатель и идентификатор монтирования "
"записываются в стандартный вывод."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The second program (I<t_open_by_handle_at.c>)  reads a mount ID and file "
"handle from standard input.  The program then employs "
"B<open_by_handle_at>()  to open the file using that handle.  If an optional "
"command-line argument is supplied, then the I<mount_fd> argument for "
"B<open_by_handle_at>()  is obtained by opening the directory named in that "
"argument.  Otherwise, I<mount_fd> is obtained by scanning I</proc/self/"
"mountinfo> to find a record whose mount ID matches the mount ID read from "
"standard input, and the mount directory specified in that record is opened.  "
"(These programs do not deal with the fact that mount IDs are not persistent.)"
msgstr ""
"Вторая программа (I<t_open_by_handle_at.c>) читает идентификатор "
"монтирования и файловый описатель из стандартного ввода. Затем программа, "
"используя описатель, применяет B<open_by_handle_at>() для открытия файла. "
"Если указан необязательный параметр командной строки, то аргумент "
"I<mount_fd> для B<open_by_handle_at>() создаётся из открытия каталога, "
"указанного в аргументе. В противном случае I<mount_fd> заполняется "
"результатом сканированием I</proc/self/mountinfo> в целях найти запись, чей "
"идентификатор монтирования совпадает с идентификатором монтирования из "
"стандартного ввода, и открывается каталог монтирования, указанный в этой "
"записи (эти программы не учитывают, что идентификатор монтирования не "
"постоянен)."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "The following shell session demonstrates the use of these two programs:"
msgstr ""
"Следующий сеанс работы в оболочке показывает использование этих программ:"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, fuzzy, no-wrap
#| msgid ""
#| "$ B<echo \\(aqCan you please think about it?\\(aq E<gt> cecilia.txt>\n"
#| "$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n"
#| "$ B<./t_open_by_handle_at E<lt> fh>\n"
#| "open_by_handle_at: Operation not permitted\n"
#| "$ B<sudo ./t_open_by_handle_at E<lt> fh>      # Need CAP_SYS_ADMIN\n"
#| "Read 31 bytes\n"
#| "$ B<rm cecilia.txt>\n"
msgid ""
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n"
"$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n"
"$ B<./t_open_by_handle_at E<lt> fh>\n"
"open_by_handle_at: Operation not permitted\n"
"$ B<sudo ./t_open_by_handle_at E<lt> fh>      # Need CAP_SYS_ADMIN\n"
"Read 31 bytes\n"
"$ B<rm cecilia.txt>\n"
msgstr ""
"$ B<echo \\(aqCan you please think about it?\\(aq E<gt> cecilia.txt>\n"
"$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n"
"$ B<./t_open_by_handle_at E<lt> fh>\n"
"open_by_handle_at: Operation not permitted\n"
"$ B<sudo ./t_open_by_handle_at E<lt> fh>      # требуется CAP_SYS_ADMIN\n"
"Read 31 bytes\n"
"$ B<rm cecilia.txt>\n"

#.  Christoph Hellwig: That's why the file handles contain a generation
#.  counter that gets incremented in this case.
#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"Now we delete and (quickly) re-create the file so that it has the same "
"content and (by chance) the same inode.  Nevertheless, "
"B<open_by_handle_at>()  recognizes that the original file referred to by the "
"file handle no longer exists."
msgstr ""
"Теперь мы удаляем и (быстро) пересоздаём файл с тем же содержимым и (если "
"повезёт) с той же инодой. Не смотря на это, B<open_by_handle_at>() "
"распознаёт, что первоначальный файл, на который указывал файловый описатель, "
"больше не существует."

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, fuzzy, no-wrap
#| msgid ""
#| "$ B<stat --printf=\"%i\\en\" cecilia.txt>     # Display inode number\n"
#| "4072121\n"
#| "$ B<rm cecilia.txt>\n"
#| "$ B<echo \\(aqCan you please think about it?\\(aq E<gt> cecilia.txt>\n"
#| "$ B<stat --printf=\"%i\\en\" cecilia.txt>     # Check inode number\n"
#| "4072121\n"
#| "$ B<sudo ./t_open_by_handle_at E<lt> fh>\n"
#| "open_by_handle_at: Stale NFS file handle\n"
msgid ""
"$ B<stat --printf=\"%i\\en\" cecilia.txt>     # Display inode number\n"
"4072121\n"
"$ B<rm cecilia.txt>\n"
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n"
"$ B<stat --printf=\"%i\\en\" cecilia.txt>     # Check inode number\n"
"4072121\n"
"$ B<sudo ./t_open_by_handle_at E<lt> fh>\n"
"open_by_handle_at: Stale NFS file handle\n"
msgstr ""
"$ B<stat --printf=\"%i\\en\" cecilia.txt>     # вывести номер иноды\n"
"4072121\n"
"$ B<rm cecilia.txt>\n"
"$ B<echo \\(aqCan you please think about it?\\(aq E<gt> cecilia.txt>\n"
"$ B<stat --printf=\"%i\\en\" cecilia.txt>     # проверить номер иноды\n"
"4072121\n"
"$ B<sudo ./t_open_by_handle_at E<lt> fh>\n"
"open_by_handle_at: Stale NFS file handle\n"

#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "Program source: t_name_to_handle_at.c"
msgstr "Исходный код программы: t_name_to_handle_at.c"

#. type: Plain text
#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron
#: opensuse-tumbleweed
#, no-wrap
msgid ""
"#define _GNU_SOURCE\n"
"#include E<lt>err.hE<gt>\n"
"#include E<lt>errno.hE<gt>\n"
"#include E<lt>fcntl.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
"\\&\n"
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int                 mount_id, fhsize, flags, dirfd;\n"
"    char                *pathname;\n"
"    struct file_handle  *fhp;\n"
"\\&\n"
"    if (argc != 2) {\n"
"        fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    pathname = argv[1];\n"
"\\&\n"
"    /* Allocate file_handle structure. */\n"
"\\&\n"
"    fhsize = sizeof(*fhp);\n"
"    fhp = malloc(fhsize);\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"malloc\");\n"
"\\&\n"
"    /* Make an initial call to name_to_handle_at() to discover\n"
"       the size required for file handle. */\n"
"\\&\n"
"    dirfd = AT_FDCWD;           /* For name_to_handle_at() calls */\n"
"    flags = 0;                  /* For name_to_handle_at() calls */\n"
"    fhp-E<gt>handle_bytes = 0;\n"
"    if (name_to_handle_at(dirfd, pathname, fhp,\n"
"                          &mount_id, flags) != -1\n"
"        || errno != EOVERFLOW)\n"
"    {\n"
"        fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    /* Reallocate file_handle structure with correct size. */\n"
"\\&\n"
"    fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n"
"    fhp = realloc(fhp, fhsize);         /* Copies fhp-E<gt>handle_bytes */\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"realloc\");\n"
"\\&\n"
"    /* Get file handle from pathname supplied on command line. */\n"
"\\&\n"
"    if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n"
"        err(EXIT_FAILURE, \"name_to_handle_at\");\n"
"\\&\n"
"    /* Write mount ID, file handle size, and file handle to stdout,\n"
"       for later reuse by t_open_by_handle_at.c. */\n"
"\\&\n"
"    printf(\"%d\\en\", mount_id);\n"
"    printf(\"%u %d   \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n"
"    for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
"        printf(\" %02x\", fhp-E<gt>f_handle[j]);\n"
"    printf(\"\\en\");\n"
"\\&\n"
"    exit(EXIT_SUCCESS);\n"
"}\n"
msgstr ""

#.  SRC END
#. type: SS
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "Program source: t_open_by_handle_at.c"
msgstr "Исходный код программы: t_open_by_handle_at.c"

#. type: Plain text
#: archlinux debian-unstable opensuse-tumbleweed
#, no-wrap
msgid ""
"#define _GNU_SOURCE\n"
"#include E<lt>err.hE<gt>\n"
"#include E<lt>fcntl.hE<gt>\n"
"#include E<lt>limits.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
"#include E<lt>string.hE<gt>\n"
"#include E<lt>sys/types.hE<gt>\n"
"#include E<lt>unistd.hE<gt>\n"
"\\&\n"
"/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n"
"   \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n"
"   \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n"
"   Open the corresponding mount path and return the resulting file\n"
"   descriptor. */\n"
"\\&\n"
"static int\n"
"open_mount_path_by_id(int mount_id)\n"
"{\n"
"    int      mi_mount_id, found;\n"
"    char     mount_path[PATH_MAX];\n"
"    char     *linep;\n"
"    FILE     *fp;\n"
"    size_t   lsize;\n"
"    ssize_t  nread;\n"
"\\&\n"
"    fp = fopen(\"/proc/self/mountinfo\", \"r\");\n"
"    if (fp == NULL)\n"
"        err(EXIT_FAILURE, \"fopen\");\n"
"\\&\n"
"    found = 0;\n"
"    linep = NULL;\n"
"    while (!found) {\n"
"        nread = getline(&linep, &lsize, fp);\n"
"        if (nread == -1)\n"
"            break;\n"
"\\&\n"
"        nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n"
"                       &mi_mount_id, mount_path);\n"
"        if (nread != 2) {\n"
"            fprintf(stderr, \"Bad sscanf()\\en\");\n"
"            exit(EXIT_FAILURE);\n"
"        }\n"
"\\&\n"
"        if (mi_mount_id == mount_id)\n"
"            found = 1;\n"
"    }\n"
"    free(linep);\n"
"\\&\n"
"    fclose(fp);\n"
"\\&\n"
"    if (!found) {\n"
"        fprintf(stderr, \"Could not find mount point\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    return open(mount_path, O_RDONLY);\n"
"}\n"
"\\&\n"
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int                 mount_id, fd, mount_fd, handle_bytes;\n"
"    char                buf[1000];\n"
"#define LINE_SIZE 100\n"
"    char                line1[LINE_SIZE], line2[LINE_SIZE];\n"
"    char                *nextp;\n"
"    ssize_t             nread;\n"
"    struct file_handle  *fhp;\n"
"\\&\n"
"    if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n"
"        fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    /* Standard input contains mount ID and file handle information:\n"
"\\&\n"
"         Line 1: E<lt>mount_idE<gt>\n"
"         Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt>   E<lt>bytes of handle in hexE<gt>\n"
"    */\n"
"\\&\n"
"    if (fgets(line1, sizeof(line1), stdin) == NULL ||\n"
"        fgets(line2, sizeof(line2), stdin) == NULL)\n"
"    {\n"
"        fprintf(stderr, \"Missing mount_id / file handle\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    mount_id = atoi(line1);\n"
"\\&\n"
"    handle_bytes = strtoul(line2, &nextp, 0);\n"
"\\&\n"
"    /* Given handle_bytes, we can now allocate file_handle structure. */\n"
"\\&\n"
"    fhp = malloc(sizeof(*fhp) + handle_bytes);\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"malloc\");\n"
"\\&\n"
"    fhp-E<gt>handle_bytes = handle_bytes;\n"
"\\&\n"
"    fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n"
"\\&\n"
"    for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
"        fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n"
"\\&\n"
"    /* Obtain file descriptor for mount point, either by opening\n"
"       the pathname specified on the command line, or by scanning\n"
"       /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n"
"       that we received from stdin. */\n"
"\\&\n"
"    if (argc E<gt> 1)\n"
"        mount_fd = open(argv[1], O_RDONLY);\n"
"    else\n"
"        mount_fd = open_mount_path_by_id(mount_id);\n"
"\\&\n"
"    if (mount_fd == -1)\n"
"        err(EXIT_FAILURE, \"opening mount fd\");\n"
"\\&\n"
"    /* Open file using handle and mount point. */\n"
"\\&\n"
"    fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n"
"    if (fd == -1)\n"
"        err(EXIT_FAILURE, \"open_by_handle_at\");\n"
"\\&\n"
"    /* Try reading a few bytes from the file. */\n"
"\\&\n"
"    nread = read(fd, buf, sizeof(buf));\n"
"    if (nread == -1)\n"
"        err(EXIT_FAILURE, \"read\");\n"
"\\&\n"
"    printf(\"Read %zd bytes\\en\", nread);\n"
"\\&\n"
"    exit(EXIT_SUCCESS);\n"
"}\n"
msgstr ""

#.  SRC END
#. type: SH
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
#, no-wrap
msgid "SEE ALSO"
msgstr "СМОТРИТЕ ТАКЖЕ"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid "B<open>(2), B<libblkid>(3), B<blkid>(8), B<findfs>(8), B<mount>(8)"
msgstr "B<open>(2), B<libblkid>(3), B<blkid>(8), B<findfs>(8), B<mount>(8)"

#. type: Plain text
#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide
#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed
msgid ""
"The I<libblkid> and I<libmount> documentation in the latest I<util-linux> "
"release at E<.UR https://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>"
msgstr ""
"Документация I<libblkid> и I<libmount> в последнем выпуске I<util-linux> E<."
"UR https://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>"

#. type: TH
#: debian-bookworm
#, no-wrap
msgid "2023-02-05"
msgstr "5 февраля 2023 г."

#. type: TH
#: debian-bookworm
#, no-wrap
msgid "Linux man-pages 6.03"
msgstr "Linux man-pages 6.03"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
msgid ""
"Other than the use of the I<handle_bytes> field, the caller should treat the "
"I<file_handle> structure as an opaque data type: the I<handle_type> and "
"I<f_handle> fields are needed only by a subsequent call to "
"B<open_by_handle_at>()."
msgstr ""
"Все остальные поля, кроме I<handle_bytes> структуры I<file_handle>, "
"вызывающий должен считать неизвестными: поля I<handle_type> и I<f_handle> "
"требуются только в последующих вызовах B<open_by_handle_at>()."

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
msgid ""
"The I<flags> argument is a bit mask constructed by ORing together zero or "
"more of B<AT_EMPTY_PATH> and B<AT_SYMLINK_FOLLOW>, described below."
msgstr ""
"Аргумент I<flags> представляет собой битовую маску (OR) из комбинации нуля "
"или более флагов B<AT_EMPTY_PATH> и B<AT_SYMLINK_FOLLOW>, описанных ниже."

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
msgid ""
"The specified I<handle> is not valid.  This error will occur if, for "
"example, the file has been deleted."
msgstr ""
"Значение I<handle> некорректно. Эта ошибка возникает, например, из-за "
"удаления файла."

#. type: Plain text
#: debian-bookworm
#, fuzzy
#| msgid ""
#| "These system calls first appeared in Linux 2.6.39.  Library support is "
#| "provided in glibc since version 2.14."
msgid ""
"These system calls first appeared in Linux 2.6.39.  Library support is "
"provided since glibc 2.14."
msgstr ""
"Данные системные вызовы впервые появились в Linux 2.6.39. Поддержка в glibc "
"появилась в версии 2.14."

#. type: Plain text
#: debian-bookworm
msgid "These system calls are nonstandard Linux extensions."
msgstr "Данные системные вызовы являются нестандартными расширениями Linux."

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
msgid ""
"Some filesystem don't support the translation of pathnames to file handles, "
"for example, I</proc>, I</sys>, and various network filesystems."
msgstr ""
"Некоторые файловые системы не поддерживают трансляцию путей в файловые "
"описатели, например: I</proc>, I</sys> и различные сетевые файловые системы."

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"#define _GNU_SOURCE\n"
"#include E<lt>err.hE<gt>\n"
"#include E<lt>errno.hE<gt>\n"
"#include E<lt>fcntl.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
msgstr ""
"#define _GNU_SOURCE\n"
"#include E<lt>err.hE<gt>\n"
"#include E<lt>errno.hE<gt>\n"
"#include E<lt>fcntl.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int                 mount_id, fhsize, flags, dirfd;\n"
"    char                *pathname;\n"
"    struct file_handle  *fhp;\n"
msgstr ""
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int                 mount_id, fhsize, flags, dirfd;\n"
"    char                *pathname;\n"
"    struct file_handle  *fhp;\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    if (argc != 2) {\n"
"        fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
msgstr ""
"    if (argc != 2) {\n"
"        fprintf(stderr, \"Использование: %s путь\\en\", argv[0]);\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    pathname = argv[1];\n"
msgstr "    pathname = argv[1];\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    /* Allocate file_handle structure. */\n"
msgstr "    /* выделяем место под структуру file_handle */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    fhsize = sizeof(*fhp);\n"
"    fhp = malloc(fhsize);\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"malloc\");\n"
msgstr ""
"    fhsize = sizeof(*fhp);\n"
"    fhp = malloc(fhsize);\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"malloc\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    /* Make an initial call to name_to_handle_at() to discover\n"
"       the size required for file handle. */\n"
msgstr ""
"    /* выполняем первоначальный вызов name_to_handle_at() для\n"
"       определения требуемого размера файлового описателя */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, fuzzy, no-wrap
#| msgid ""
#| "    dirfd = AT_FDCWD;           /* For name_to_handle_at() calls */\n"
#| "    flags = 0;                  /* For name_to_handle_at() calls */\n"
#| "    fhp-E<gt>handle_bytes = 0;\n"
#| "    if (name_to_handle_at(dirfd, pathname, fhp,\n"
#| "                &mount_id, flags) != -1 || errno != EOVERFLOW) {\n"
#| "        fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n"
#| "        exit(EXIT_FAILURE);\n"
#| "    }\n"
msgid ""
"    dirfd = AT_FDCWD;           /* For name_to_handle_at() calls */\n"
"    flags = 0;                  /* For name_to_handle_at() calls */\n"
"    fhp-E<gt>handle_bytes = 0;\n"
"    if (name_to_handle_at(dirfd, pathname, fhp,\n"
"                          &mount_id, flags) != -1\n"
"        || errno != EOVERFLOW)\n"
"    {\n"
"        fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
msgstr ""
"    dirfd = AT_FDCWD;           /* для вызовов name_to_handle_at() */\n"
"    flags = 0;                  /* для вызовов name_to_handle_at() */\n"
"    fhp-E<gt>handle_bytes = 0;\n"
"    if (name_to_handle_at(dirfd, pathname, fhp,\n"
"                &mount_id, flags) != -1 || errno != EOVERFLOW) {\n"
"        fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    /* Reallocate file_handle structure with correct size. */\n"
msgstr "    /* перераспределяем структуру file_handle с правильным размером */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, fuzzy, no-wrap
#| msgid ""
#| "    fhsize = sizeof(struct file_handle) + fhp-E<gt>handle_bytes;\n"
#| "    fhp = realloc(fhp, fhsize);         /* Copies fhp-E<gt>handle_bytes */\n"
#| "    if (fhp == NULL)\n"
#| "        errExit(\"realloc\");\n"
msgid ""
"    fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n"
"    fhp = realloc(fhp, fhsize);         /* Copies fhp-E<gt>handle_bytes */\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"realloc\");\n"
msgstr ""
"    fhsize = sizeof(struct file_handle) + fhp-E<gt>handle_bytes;\n"
"    fhp = realloc(fhp, fhsize);         /* копируем fhp-E<gt>handle_bytes */\n"
"    if (fhp == NULL)\n"
"        errExit(\"realloc\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    /* Get file handle from pathname supplied on command line. */\n"
msgstr ""
"    /* получаем файловый описатель из пути, который\n"
"       указан в командной строке */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n"
"        err(EXIT_FAILURE, \"name_to_handle_at\");\n"
msgstr ""
"    if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n"
"        err(EXIT_FAILURE, \"name_to_handle_at\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    /* Write mount ID, file handle size, and file handle to stdout,\n"
"       for later reuse by t_open_by_handle_at.c. */\n"
msgstr ""
"    /* пишем идентификатор монтирования, размер файлового описателя\n"
"       и файловый описатель в stdout\n"
"       для повторного использования в t_open_by_handle_at.c */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    printf(\"%d\\en\", mount_id);\n"
"    printf(\"%u %d   \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n"
"    for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
"        printf(\" %02x\", fhp-E<gt>f_handle[j]);\n"
"    printf(\"\\en\");\n"
msgstr ""
"    printf(\"%d\\en\", mount_id);\n"
"    printf(\"%u %d   \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n"
"    for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
"        printf(\" %02x\", fhp-E<gt>f_handle[j]);\n"
"    printf(\"\\en\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    exit(EXIT_SUCCESS);\n"
"}\n"
msgstr ""
"    exit(EXIT_SUCCESS);\n"
"}\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"#define _GNU_SOURCE\n"
"#include E<lt>err.hE<gt>\n"
"#include E<lt>fcntl.hE<gt>\n"
"#include E<lt>limits.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
"#include E<lt>string.hE<gt>\n"
"#include E<lt>unistd.hE<gt>\n"
msgstr ""
"#define _GNU_SOURCE\n"
"#include E<lt>err.hE<gt>\n"
"#include E<lt>fcntl.hE<gt>\n"
"#include E<lt>limits.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
"#include E<lt>string.hE<gt>\n"
"#include E<lt>unistd.hE<gt>\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, fuzzy, no-wrap
#| msgid ""
#| "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n"
#| "   \\(aqmount_id\\(aq. (An easier way to do this is to install and use the\n"
#| "   \\(aqlibmount\\(aq library provided by the \\(aqutil-linux\\(aq project.)\n"
#| "   Open the corresponding mount path and return the resulting file\n"
#| "   descriptor. */\n"
msgid ""
"/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n"
"   \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n"
"   \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n"
"   Open the corresponding mount path and return the resulting file\n"
"   descriptor. */\n"
msgstr ""
"/* сканируем /proc/self/mountinfo в поиске строки, чей идентификатор\n"
"   монтирования совпадает с \\(aqmount_id\\(aq (простейший способ,\n"
"   это установить и использовать библиотеку\n"
"   «libmount», предоставляемую проектом «util-linux»).\n"
"   Открываем соответствующий путь монтирования и возвращаем\n"
"   полученный файловый дескриптор. */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"static int\n"
"open_mount_path_by_id(int mount_id)\n"
"{\n"
"    int      mi_mount_id, found;\n"
"    char     mount_path[PATH_MAX];\n"
"    char     *linep;\n"
"    FILE     *fp;\n"
"    size_t   lsize;\n"
"    ssize_t  nread;\n"
msgstr ""
"static int\n"
"open_mount_path_by_id(int mount_id)\n"
"{\n"
"    int      mi_mount_id, found;\n"
"    char     mount_path[PATH_MAX];\n"
"    char     *linep;\n"
"    FILE     *fp;\n"
"    size_t   lsize;\n"
"    ssize_t  nread;\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    fp = fopen(\"/proc/self/mountinfo\", \"r\");\n"
"    if (fp == NULL)\n"
"        err(EXIT_FAILURE, \"fopen\");\n"
msgstr ""
"    fp = fopen(\"/proc/self/mountinfo\", \"r\");\n"
"    if (fp == NULL)\n"
"        err(EXIT_FAILURE, \"fopen\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    found = 0;\n"
"    linep = NULL;\n"
"    while (!found) {\n"
"        nread = getline(&linep, &lsize, fp);\n"
"        if (nread == -1)\n"
"            break;\n"
msgstr ""
"    found = 0;\n"
"    linep = NULL;\n"
"    while (!found) {\n"
"        nread = getline(&linep, &lsize, fp);\n"
"        if (nread == -1)\n"
"            break;\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"        nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n"
"                       &mi_mount_id, mount_path);\n"
"        if (nread != 2) {\n"
"            fprintf(stderr, \"Bad sscanf()\\en\");\n"
"            exit(EXIT_FAILURE);\n"
"        }\n"
msgstr ""
"        nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n"
"                       &mi_mount_id, mount_path);\n"
"        if (nread != 2) {\n"
"            fprintf(stderr, \"Bad sscanf()\\en\");\n"
"            exit(EXIT_FAILURE);\n"
"        }\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"        if (mi_mount_id == mount_id)\n"
"            found = 1;\n"
"    }\n"
"    free(linep);\n"
msgstr ""
"        if (mi_mount_id == mount_id)\n"
"            found = 1;\n"
"    }\n"
"    free(linep);\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    fclose(fp);\n"
msgstr "    fclose(fp);\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    if (!found) {\n"
"        fprintf(stderr, \"Could not find mount point\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
msgstr ""
"    if (!found) {\n"
"        fprintf(stderr, \"Could not find mount point\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    return open(mount_path, O_RDONLY);\n"
"}\n"
msgstr ""
"    return open(mount_path, O_RDONLY);\n"
"}\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int                 mount_id, fd, mount_fd, handle_bytes;\n"
"    char                buf[1000];\n"
"#define LINE_SIZE 100\n"
"    char                line1[LINE_SIZE], line2[LINE_SIZE];\n"
"    char                *nextp;\n"
"    ssize_t             nread;\n"
"    struct file_handle  *fhp;\n"
msgstr ""
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int                 mount_id, fd, mount_fd, handle_bytes;\n"
"    char                buf[1000];\n"
"#define LINE_SIZE 100\n"
"    char                line1[LINE_SIZE], line2[LINE_SIZE];\n"
"    char                *nextp;\n"
"    ssize_t             nread;\n"
"    struct file_handle  *fhp;\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n"
"        fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
msgstr ""
"    if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n"
"        fprintf(stderr, \"Использование: %s [путь-монт.]\\en\", argv[0]);\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    /* Standard input contains mount ID and file handle information:\n"
msgstr ""
"    /* Стандартный ввод содержит идентификатор монтирования и\n"
"       информацию о файловом описателе:\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"         Line 1: E<lt>mount_idE<gt>\n"
"         Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt>   E<lt>bytes of handle in hexE<gt>\n"
"    */\n"
msgstr ""
"         Строка 1: E<lt>идентификатор монтированияE<gt>\n"
"         Строка 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt>\n"
"                    E<lt>байты описателя в шестнад. системе счисленияE<gt>\n"
"    */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, fuzzy, no-wrap
#| msgid ""
#| "    if ((fgets(line1, sizeof(line1), stdin) == NULL) ||\n"
#| "           (fgets(line2, sizeof(line2), stdin) == NULL)) {\n"
#| "        fprintf(stderr, \"Missing mount_id / file handle\\en\");\n"
#| "        exit(EXIT_FAILURE);\n"
#| "    }\n"
msgid ""
"    if (fgets(line1, sizeof(line1), stdin) == NULL ||\n"
"        fgets(line2, sizeof(line2), stdin) == NULL)\n"
"    {\n"
"        fprintf(stderr, \"Missing mount_id / file handle\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
msgstr ""
"    if ((fgets(line1, sizeof(line1), stdin) == NULL) ||\n"
"           (fgets(line2, sizeof(line2), stdin) == NULL)) {\n"
"        fprintf(stderr, \"Missing mount_id / file handle\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    mount_id = atoi(line1);\n"
msgstr "    mount_id = atoi(line1);\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    handle_bytes = strtoul(line2, &nextp, 0);\n"
msgstr "    handle_bytes = strtoul(line2, &nextp, 0);\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    /* Given handle_bytes, we can now allocate file_handle structure. */\n"
msgstr ""
"    /* получаем handle_bytes, теперь мы можем выделить место\n"
"       под структуру file_handle */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    fhp = malloc(sizeof(*fhp) + handle_bytes);\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"malloc\");\n"
msgstr ""
"    fhp = malloc(sizeof(*fhp) + handle_bytes);\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"malloc\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    fhp-E<gt>handle_bytes = handle_bytes;\n"
msgstr "    fhp-E<gt>handle_bytes = handle_bytes;\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n"
msgstr "    fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
"        fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n"
msgstr ""
"    for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
"        fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, fuzzy, no-wrap
#| msgid ""
#| "    /* Obtain file descriptor for mount point, either by opening\n"
#| "       the pathname specified on the command line, or by scanning\n"
#| "       /proc/self/mounts to find a mount that matches the \\(aqmount_id\\(aq\n"
#| "       that we received from stdin. */\n"
msgid ""
"    /* Obtain file descriptor for mount point, either by opening\n"
"       the pathname specified on the command line, or by scanning\n"
"       /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n"
"       that we received from stdin. */\n"
msgstr ""
"    /* получаем файловый дескриптор для точки монтирования, или\n"
"       открываем путь, указанный в командной строке, или сканируем\n"
"       /proc/self/mounts в поиске монтирования, которое совпадает с\n"
"       «mount_id», который мы получили из stdin. */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    if (argc E<gt> 1)\n"
"        mount_fd = open(argv[1], O_RDONLY);\n"
"    else\n"
"        mount_fd = open_mount_path_by_id(mount_id);\n"
msgstr ""
"    if (argc E<gt> 1)\n"
"        mount_fd = open(argv[1], O_RDONLY);\n"
"    else\n"
"        mount_fd = open_mount_path_by_id(mount_id);\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    if (mount_fd == -1)\n"
"        err(EXIT_FAILURE, \"opening mount fd\");\n"
msgstr ""
"    if (mount_fd == -1)\n"
"        err(EXIT_FAILURE, \"opening mount fd\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    /* Open file using handle and mount point. */\n"
msgstr "    /* открываем файл, используя описатель и точку монтирования */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n"
"    if (fd == -1)\n"
"        err(EXIT_FAILURE, \"open_by_handle_at\");\n"
msgstr ""
"    fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n"
"    if (fd == -1)\n"
"        err(EXIT_FAILURE, \"open_by_handle_at\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    /* Try reading a few bytes from the file. */\n"
msgstr "    /* пытаемся прочитать несколько байт из файла */\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid ""
"    nread = read(fd, buf, sizeof(buf));\n"
"    if (nread == -1)\n"
"        err(EXIT_FAILURE, \"read\");\n"
msgstr ""
"    nread = read(fd, buf, sizeof(buf));\n"
"    if (nread == -1)\n"
"        err(EXIT_FAILURE, \"read\");\n"

#. type: Plain text
#: debian-bookworm opensuse-leap-15-6
#, no-wrap
msgid "    printf(\"Read %zd bytes\\en\", nread);\n"
msgstr "    printf(\"Read %zd bytes\\en\", nread);\n"

#. type: TH
#: fedora-40 fedora-rawhide mageia-cauldron
#, no-wrap
msgid "2023-10-31"
msgstr "31 октября 2023 г."

#. type: TH
#: fedora-40 mageia-cauldron
#, no-wrap
msgid "Linux man-pages 6.06"
msgstr "Linux man-pages 6.06"

#. type: Plain text
#: fedora-40 fedora-rawhide mageia-cauldron
#, no-wrap
msgid ""
"#define _GNU_SOURCE\n"
"#include E<lt>err.hE<gt>\n"
"#include E<lt>fcntl.hE<gt>\n"
"#include E<lt>limits.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
"#include E<lt>string.hE<gt>\n"
"#include E<lt>unistd.hE<gt>\n"
"\\&\n"
"/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n"
"   \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n"
"   \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n"
"   Open the corresponding mount path and return the resulting file\n"
"   descriptor. */\n"
"\\&\n"
"static int\n"
"open_mount_path_by_id(int mount_id)\n"
"{\n"
"    int      mi_mount_id, found;\n"
"    char     mount_path[PATH_MAX];\n"
"    char     *linep;\n"
"    FILE     *fp;\n"
"    size_t   lsize;\n"
"    ssize_t  nread;\n"
"\\&\n"
"    fp = fopen(\"/proc/self/mountinfo\", \"r\");\n"
"    if (fp == NULL)\n"
"        err(EXIT_FAILURE, \"fopen\");\n"
"\\&\n"
"    found = 0;\n"
"    linep = NULL;\n"
"    while (!found) {\n"
"        nread = getline(&linep, &lsize, fp);\n"
"        if (nread == -1)\n"
"            break;\n"
"\\&\n"
"        nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n"
"                       &mi_mount_id, mount_path);\n"
"        if (nread != 2) {\n"
"            fprintf(stderr, \"Bad sscanf()\\en\");\n"
"            exit(EXIT_FAILURE);\n"
"        }\n"
"\\&\n"
"        if (mi_mount_id == mount_id)\n"
"            found = 1;\n"
"    }\n"
"    free(linep);\n"
"\\&\n"
"    fclose(fp);\n"
"\\&\n"
"    if (!found) {\n"
"        fprintf(stderr, \"Could not find mount point\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    return open(mount_path, O_RDONLY);\n"
"}\n"
"\\&\n"
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    int                 mount_id, fd, mount_fd, handle_bytes;\n"
"    char                buf[1000];\n"
"#define LINE_SIZE 100\n"
"    char                line1[LINE_SIZE], line2[LINE_SIZE];\n"
"    char                *nextp;\n"
"    ssize_t             nread;\n"
"    struct file_handle  *fhp;\n"
"\\&\n"
"    if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n"
"        fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    /* Standard input contains mount ID and file handle information:\n"
"\\&\n"
"         Line 1: E<lt>mount_idE<gt>\n"
"         Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt>   E<lt>bytes of handle in hexE<gt>\n"
"    */\n"
"\\&\n"
"    if (fgets(line1, sizeof(line1), stdin) == NULL ||\n"
"        fgets(line2, sizeof(line2), stdin) == NULL)\n"
"    {\n"
"        fprintf(stderr, \"Missing mount_id / file handle\\en\");\n"
"        exit(EXIT_FAILURE);\n"
"    }\n"
"\\&\n"
"    mount_id = atoi(line1);\n"
"\\&\n"
"    handle_bytes = strtoul(line2, &nextp, 0);\n"
"\\&\n"
"    /* Given handle_bytes, we can now allocate file_handle structure. */\n"
"\\&\n"
"    fhp = malloc(sizeof(*fhp) + handle_bytes);\n"
"    if (fhp == NULL)\n"
"        err(EXIT_FAILURE, \"malloc\");\n"
"\\&\n"
"    fhp-E<gt>handle_bytes = handle_bytes;\n"
"\\&\n"
"    fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n"
"\\&\n"
"    for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
"        fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n"
"\\&\n"
"    /* Obtain file descriptor for mount point, either by opening\n"
"       the pathname specified on the command line, or by scanning\n"
"       /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n"
"       that we received from stdin. */\n"
"\\&\n"
"    if (argc E<gt> 1)\n"
"        mount_fd = open(argv[1], O_RDONLY);\n"
"    else\n"
"        mount_fd = open_mount_path_by_id(mount_id);\n"
"\\&\n"
"    if (mount_fd == -1)\n"
"        err(EXIT_FAILURE, \"opening mount fd\");\n"
"\\&\n"
"    /* Open file using handle and mount point. */\n"
"\\&\n"
"    fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n"
"    if (fd == -1)\n"
"        err(EXIT_FAILURE, \"open_by_handle_at\");\n"
"\\&\n"
"    /* Try reading a few bytes from the file. */\n"
"\\&\n"
"    nread = read(fd, buf, sizeof(buf));\n"
"    if (nread == -1)\n"
"        err(EXIT_FAILURE, \"read\");\n"
"\\&\n"
"    printf(\"Read %zd bytes\\en\", nread);\n"
"\\&\n"
"    exit(EXIT_SUCCESS);\n"
"}\n"
msgstr ""

#. type: TH
#: fedora-rawhide
#, no-wrap
msgid "Linux man-pages 6.7"
msgstr "Linux man-pages 6.7"

#. type: TH
#: opensuse-leap-15-6
#, no-wrap
msgid "2023-03-30"
msgstr "30 марта 2023 г."

#. type: TH
#: opensuse-leap-15-6
#, no-wrap
msgid "Linux man-pages 6.04"
msgstr "Linux man-pages 6.04"

#. type: TH
#: opensuse-tumbleweed
#, fuzzy, no-wrap
#| msgid "Linux man-pages 6.7"
msgid "Linux man-pages (unreleased)"
msgstr "Linux man-pages 6.7"