# Arabic translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # زايد السعيدي , 2026. msgid "" msgstr "" "Project-Id-Version: manpages-l10n 4.30.2\n" "POT-Creation-Date: 2026-06-05 06:33+0200\n" "PO-Revision-Date: 2026-05-18 18:46+0400\n" "Last-Translator: Zayed Al-Saidi \n" "Language-Team: Arabic \n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" "X-Generator: Lokalize 23.08.5\n" #. type: TH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "open_by_handle_at" msgstr "open_by_handle_at" #. type: TH #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "2026-02-22" msgstr "22 فبراير 2026" #. type: TH #: archlinux debian-unstable #, no-wrap msgid "Linux man-pages 6.18" msgstr "صفحات دليل لينكس 6.18" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "الاسم" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "المكتبة" #. type: Plain text #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "Standard C library (I,\\ I<-lc>)" msgstr "مكتبة سي المعيارية (I،\\ I<-lc>)" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "موجز" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" "B<#include Efcntl.hE>\n" msgstr "" "B<#define _GNU_SOURCE> /* انظر feature_test_macros(7) */\n" "B<#include Efcntl.hE>\n" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "BIB<, const char *>IB<,>\n" "B< struct file_handle *>IB<,>\n" "B< int *>IB<, int >IB<);>\n" "BIB<, struct file_handle *>IB<,>\n" "B< int >IB<);>\n" msgstr "" "BIB<, const char *>IB<,>\n" "B< struct file_handle *>IB<,>\n" "B< int *>IB<, int >IB<);>\n" "BIB<, struct file_handle *>IB<,>\n" "B< int >IB<);>\n" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "الوصف" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B() and B() system calls split " "the functionality of B(2) into two parts: B() " "returns an opaque handle that corresponds to a specified file; " "B() opens the file corresponding to a handle returned by " "a previous call to B() and returns an open file " "descriptor." msgstr "" "استدعاءات النظام B() و B() تقسم وظيفة " "B(2) إلى جزئين: يُعيد B() مقبضًا غير شفاف يتوافق مع " "ملف محدد؛ ويفتح B() الملف المقابل لمقبض أُعيد بواسطة " "استدعاء سابق لـ B() ويُعيد واصف ملف مفتوح." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "name_to_handle_at()" msgstr "name_to_handle_at()" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The B() system call returns a file handle and a mount ID " "corresponding to the file specified by the I and I arguments. " "The file handle is returned via the argument I, which is a pointer " "to a structure of the following form:" msgstr "" "يُعيد استدعاء النظام B() مقبض ملف ومعرف وصل يتوافقان مع " "الملف المحدد بوسيطي I و I. يُعاد مقبض الملف عبر الوسيط " "I، وهو مؤشر لبنية بالشكل التالي:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 [مدخل، مخرج] */\n" " int handle_type; /* نوع المقبض [مخرج] */\n" " unsigned char f_handle[0]; /* معرف الملف (حدد حجمه\n" " المستدعِي) [مخرج] */\n" "};\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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. Before the call, " "the I field should be initialized to contain the allocated " "size for I. (The constant B, defined in " "Ifcntl.hE>, 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 field is " "updated to contain the number of bytes actually written to I." msgstr "" "تقع على عاتق المستدعِي مسؤولية تخصيص البنية بحجم كبير كافٍ لاحتواء المقبض " "المُعاد في I. قبل الاستدعاء، يجب تهيئة الحقل I " "لاحتواء الحجم المخصص لـ I. (يحدد الثابت B، المُعرّف " "في Ifcntl.hE>، أقصى حجم متوقع لمقبض ملف. ليس حدًا أعلى مضمونًا لأن " "أنظمة الملفات المستقبلية قد تتطلب مساحة أكبر.) عند النجاح، يُحدّث الحقل " "I لاحتواء عدد البايتات المكتوبة فعليًا في I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The caller can discover the required size for the I structure " "by making a call in which Ihandle_bytes> is zero; in this case, " "the call fails with the error B and Ihandle_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 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 error is returned without I being increased." msgstr "" "يمكن للمستدعِي اكتشاف الحجم المطلوب لبنية I عبر إجراء استدعاء " "تكون فيه قيمة Ihandle_bytes> صفرًا؛ وفي هذه الحالة، يفشل " "الاستدعاء بالخطأ B وتُضبط قيمة Ihandle_bytes> للإشارة " "إلى الحجم المطلوب؛ يمكن للمستدعِي بعد ذلك استخدام هذه المعلومات لتخصيص بنية " "بالحجم الصحيح (انظر الأمثلة أدناه). يجب توخي الحذر هنا لأن B قد " "يشير أيضًا إلى عدم توفر مقبض ملف لهذا الاسم المعين في نظام ملفات يدعم عادةً " "البحث عن مقابض الملفات. يمكن اكتشاف هذه الحالة عند إرجاع الخطأ B " "دون زيادة I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Other than the use of the I field, the caller should treat the " "I structure as an opaque data type: the I and " "I fields can be used in a subsequent call to " "B(). The caller can also use the opaque I " "to compare the identity of filesystem objects that were queried at different " "times and possibly at different paths. The B(7) subsystem can " "report events with an information record containing a I to " "identify the filesystem object." msgstr "" "بخلاف استخدام حقل I، يجب على المستدعِي معاملة بنية " "I كنوع بيانات غير شفاف: يمكن استخدام حقلي I و " "I في استدعاء لاحق لـ B(). يمكن للمستدعِي أيضًا " "استخدام I غير الشفاف لمقارنة هوية كائنات نظام الملفات التي تم " "الاستعلام عنها في أوقات مختلفة وربما في مسارات مختلفة. يمكن للنظام الفرعي " "B(7) الإبلاغ عن الأحداث بسجل معلومات يحتوي على I " "لتحديد كائن نظام الملفات." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The I argument is a bit mask constructed by ORing together zero or " "more of B, B, " "B, B, and B, " "described below." msgstr "" "الوسيط I هو قناع بتات يُبنى عبر إجراء عملية OR لصفر أو أكثر من " "B و B و B و " "B و B، الموصوفة أدناه." #. commit 96b2b072ee62be8ae68c8ecf14854c4d0505a8f8 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "When I contain the B (since Linux 6.5) flag, the " "caller indicates that the returned I 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() with the returned " "I may fail." msgstr "" "عندما يحتوي I على علم B (منذ لينكس 6.5)، يشير المستدعِي " "إلى أن I المُعاد مطلوب لتحديد كائن نظام الملفات، وليس لفتح الملف " "لاحقًا، لذا يُتوقع أن استدعاءً لاحقًا لـ B() باستخدام " "I المُعاد قد يفشل." #. commit 4356d575ef0f39a3e8e0ce0c40d84ce900ac3b61 #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "When I contain the B (since Linux 6.12) " "flag, the caller indicates that the width of the I buffer is at " "least 64 bits, and then the mount id returned in that buffer is the unique " "mount id as the one returned by B(2) with the B " "flag." msgstr "" "عندما يحتوي I على علم B (منذ لينكس 6.12)، " "يشير المستدعِي إلى أن عرض المخزن المؤقت I هو 64 بت على الأقل، " "وعندها يكون معرف الوصل المُعاد في ذلك المخزن هو معرف الوصل الفريد مثل ذلك " "الذي يُعيده B(2) مع علم B." #. commit a20853ab8296d4a8754482cb5e9adde8ab426a25 #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "When I contain the B (since Linux 6.13) flag, " "the caller indicates that the returned I is needed to open a " "file with known path later, so it should be expected that a subsequent call " "to B() with the returned I may fail if the " "file was moved, but otherwise, the path of the opened file is expected to be " "visible from the IpidI* magic link. This flag can not be used " "in combination with the flags B and/or B." msgstr "" "عندما يحتوي I على علم B (منذ لينكس 6.13)، يشير " "المستدعِي إلى أن I المُعاد مطلوب لفتح ملف بمسار معروف لاحقًا، لذا " "يُتوقع أن استدعاءً لاحقًا لـ B() باستخدام I " "المُعاد قد يفشل إذا نُقل الملف، ولكن بخلاف ذلك، يُتوقع أن يكون مسار الملف " "المفتوح مرئيًا من الرابط السحري IpidI*. لا يمكن استخدام هذا " "العلم مع علمي B و/أو B." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "Together, the I and I arguments identify the file for which a " "handle is to be obtained. There are four distinct cases:" msgstr "" "يحدد وسيطا I و I معًا الملف المطلوب الحصول على مقبض له. هناك " "أربع حالات متميزة:" #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\[bu]" msgstr "\\[bu]" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If I 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 is ignored." msgstr "" "إذا كان I سلسلة غير فارغة تحتوي على اسم مسار مطلق، فيُعاد مقبض للملف " "المشار إليه باسم المسار ذلك. وفي هذه الحالة، يُتجاهل I." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If I is a nonempty string containing a relative pathname and I " "has the special value B, then I 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 سلسلة غير فارغة تحتوي على اسم مسار نسبي وكانت قيمة I " "هي القيمة الخاصة B، فيُفسر I بالنسبة إلى دليل العمل الحالي " "للمستدعِي، ويُعاد مقبض للملف الذي يشير إليه." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If I is a nonempty string containing a relative pathname and I " "is a file descriptor referring to a directory, then I is interpreted " "relative to the directory referred to by I, and a handle is returned " "for the file to which it refers. (See B(2) for an explanation of " "why \"directory file descriptors\" are useful.)" msgstr "" "إذا كان I سلسلة غير فارغة تحتوي على اسم مسار نسبي وكان I واصف " "ملف يشير إلى دليل، فيُفسر I بالنسبة إلى الدليل المشار إليه بواسطة " "I، ويُعاد مقبض للملف الذي يشير إليه. (انظر B(2) لشرح سبب فائدة " "\"واصفات ملفات الدليل\".)" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If I is an empty string and I specifies the value " "B, then I can be an open file descriptor referring to " "any type of file, or B, meaning the current working directory, and " "a handle is returned for the file to which it refers." msgstr "" "إذا كان I سلسلة فارغة وحدد I القيمة B، فيمكن أن " "يكون I واصف ملف مفتوح يشير إلى أي نوع من الملفات، أو B، " "بمعنى دليل العمل الحالي، ويُعاد مقبض للملف الذي يشير إليه." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The I argument returns an identifier for the filesystem mount that " "corresponds to I. This corresponds to the first field in one of the " "records in I. 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(). " "I is returned both for a successful call and for a call that " "results in the error B." msgstr "" "يُعيد وسيط I معرفًا لوصل نظام الملفات الذي يتوافق مع I. يتوافق " "هذا مع الحقل الأول في أحد السجلات في I. ويؤدي فتح اسم " "المسار في الحقل الخامس من ذلك السجل إلى الحصول على واصف ملف لنقطة الوصل؛ " "يمكن استخدام واصف الملف هذا في استدعاء لاحق لـ B(). يُعاد " "I في حال نجاح الاستدعاء وأيضًا في حال الاستدعاء الذي ينتج عنه الخطأ " "B." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "By default, B() does not dereference I if it is a " "symbolic link, and thus returns a handle for the link itself. If " "B is specified in I, I 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() المسار I إذا كان رابطًا رمزيًا، " "وبالتالي يُعيد مقبضًا للرابط نفسه. إذا حُدد B في I، " "فسيُتبع المسار I إذا كان رابطًا رمزيًا (بحيث يُعيد الاستدعاء مقبضًا للملف " "الذي يشير إليه الرابط)." #. commit 20fa19027286983ab2734b5910c4a687436e0c31 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() 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() call on an automount " "point will return with error B without having increased " "I. 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() عملية وصل عندما يكون المكون الأخير من اسم " "المسار نقطة وصل آلي. عندما يدعم نظام ملفات مقابض الملفات ونقاط الوصل الآلي " "معًا، فإن استدعاء B() على نقطة وصل آلي سينتهي بالخطأ " "B دون زيادة I. يمكن أن يحدث هذا منذ لينكس 4.13 مع " "NFS عند الوصول إلى دليل موجود على نظام ملفات منفصل على الخادم. في هذه " "الحالة، يمكن إطلاق الوصل الآلي عبر إضافة \"/\" إلى نهاية اسم المسار." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "open_by_handle_at()" msgstr "open_by_handle_at()" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B() system call opens the file referred to by " "I, a file handle returned by a previous call to " "B()." msgstr "" "يفتح استدعاء النظام B() الملف المشار إليه بواسطة " "I، وهو مقبض ملف أُعيد بواسطة استدعاء سابق لـ B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The I argument is a file descriptor for any object (file, " "directory, etc.) in the mounted filesystem with respect to which I " "should be interpreted. The special value B can be specified, " "meaning the current working directory of the caller." msgstr "" "وسيط I هو واصف ملف لأي كائن (ملف، دليل، إلخ) في نظام الملفات " "الموصول والذي يجب تفسير I بالنسبة إليه. يمكن تحديد القيمة الخاصة " "B، وتعني دليل العمل الحالي للمستدعِي." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The I argument is as for B(2). If I refers to a " "symbolic link, the caller must specify the B flag, and the symbolic " "link is not dereferenced; the B flag, if specified, is ignored." msgstr "" "وسيط I مماثل لوسيط B(2). إذا كان I يشير إلى رابط رمزي، " "فيجب على المستدعِي تحديد علم B، ولا يُتبع الرابط الرمزي؛ ويُتجاهل علم " "B إذا حُدد." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The caller must have the B capability to invoke " "B()." msgstr "" "يجب أن يمتلك المستدعِي قدرة B لاستدعاء " "B()." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "قيمة الإرجاع" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "On success, B() returns 0, and B() " "returns a file descriptor (a nonnegative integer)." msgstr "" "عند النجاح، يُعيد B() القيمة 0، ويُعيد " "B() واصف ملف (عدد صحيح غير سالب)." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "In the event of an error, both system calls return -1 and set I to " "indicate the error." msgstr "" "في حال حدوث خطأ، يُعيد كلا الاستدعاءين -1 وتُضبط قيمة I للإشارة إلى " "الخطأ." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "ERRORS" msgstr "الأخطاء" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() and B() can fail for the same " "errors as B(2). In addition, they can fail with the errors noted " "below." msgstr "" "يمكن أن يفشل B() و B() لنفس أخطاء " "B(2). وبالإضافة إلى ذلك، يمكن أن يفشلا بالأخطاء المذكورة أدناه." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B() can fail with the following errors:" msgstr "يمكن أن يفشل B() بالأخطاء التالية:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "I, I, or I points outside your accessible address " "space." msgstr "" "يشير I أو I أو I إلى خارج مساحة العنوان القابلة " "للوصول." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "I includes an invalid bit value or an invalid bit combination." msgstr "يتضمن I قيمة بت غير صالحة أو تركيبة بتات غير صالحة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Ihandle_bytes> is greater than B." msgstr "قيمة Ihandle_bytes> أكبر من B." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "I is an empty string, but B was not specified in " "I." msgstr "المسار I سلسلة فارغة، ولكن لم يُحدد B في I." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The file descriptor supplied in I does not refer to a directory, and " "it is not the case that both I includes B and I " "is an empty string." msgstr "" "واصف الملف المقدم في I لا يشير إلى دليل، وليست هذه هي الحالة التي " "يتضمن فيها I العلم B ويكون I سلسلة فارغة." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The filesystem does not support decoding of a pathname to a file handle." msgstr "نظام الملفات لا يدعم فك ترميز اسم مسار إلى مقبض ملف." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The Ihandle_bytes> value passed into the call was too small. " "When this error occurs, Ihandle_bytes> is updated to indicate " "the required size for the handle." msgstr "" "قيمة Ihandle_bytes> الممررة في الاستدعاء كانت صغيرة جدًا. عند " "حدوث هذا الخطأ، تُحدث قيمة Ihandle_bytes> للإشارة إلى الحجم " "المطلوب للمقبض." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B() can fail with the following errors:" msgstr "يمكن أن يفشل B() بالأخطاء التالية:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is not an open file descriptor." msgstr "I ليس واصف ملف مفتوح." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "I is relative but I is neither B nor a valid file " "descriptor." msgstr "المسار I نسبي ولكن I ليس B ولا واصف ملف صالح." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I points outside your accessible address space." msgstr "يشير I إلى خارج مساحة العنوان القابل للوصول." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Ihandle_bytes> is greater than B or is equal to " "zero." msgstr "" "قيمة Ihandle_bytes> أكبر من B أو تساوي الصفر." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I refers to a symbolic link, but B was not specified in " "I." msgstr "يشير I إلى رابط رمزي، ولكن لم يُحدد B في I." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The caller does not have the B capability." msgstr "المستدعِي لا يملك قدرة B." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The specified I 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 was acquired using the B flag and the " "filesystem does not support B(). This error can also " "occur if the I was acquired using the B flag " "and the file was moved to a different parent." msgstr "" "قيمة I المحددة غير صالحة لفتح ملف. يحدث هذا الخطأ إذا حُذف الملف " "مثلًا. ويمكن أن يحدث هذا الخطأ أيضًا إذا تم الحصول على I باستخدام علم " "B ونظام الملفات لا يدعم B(). كما يمكن أن " "يحدث هذا الخطأ إذا تم الحصول على I باستخدام علم " "B ونُقل الملف إلى أصل مختلف." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "VERSIONS" msgstr "الإصدارات" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "FreeBSD has a broadly similar pair of system calls in the form of " "B() and B()." msgstr "" "يحتوي FreeBSD على زوج مشابه إلى حد كبير من استدعاءات النظام في شكل " "B() و B()." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "المعايير" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux." msgstr "لينكس." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "التاريخ" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux 2.6.39, glibc 2.14." msgstr "لينكس 2.6.39، glibc 2.14." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NOTES" msgstr "ملاحظات" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A file handle can be generated in one process using B() " "and later used in a different process that calls B()." msgstr "" "يمكن إنشاء مقبض ملف في عملية واحدة باستخدام B() " "واستخدامه لاحقًا في عملية مختلفة تستدعي B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Some filesystem don't support the translation of pathnames to file handles, " "for example, I, I, and various network filesystems. Some " "filesystems support the translation of pathnames to file handles, but do not " "support using those file handles in B()." msgstr "" "بعض أنظمة الملفات لا تدعم ترجمة أسماء المسارات إلى مقابض ملفات، على سبيل " "المثال، I و I وأنظمة ملفات شبكية متنوعة. بعض أنظمة الملفات تدعم " "ترجمة أسماء المسارات إلى مقابض ملفات، لكنها لا تدعم استخدام مقابض الملفات " "تلك في B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 error from B()." msgstr "" "قد يصبح مقبض الملف غير صالح (\"قديم\") إذا تم حذف ملف، أو لأسباب أخرى خاصة " "بنظام الملفات. يتم الإبلاغ عن المقابض غير الصالحة بواسطة خطأ B من " "B()." #. https://lwn.net/Articles/375888/ #. "Open by handle" - Jonathan Corbet, 2010-02-23 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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. لاحقًا، عندما يريد العميل فتح الملف، يمكنه تمرير المقبض مرة أخرى إلى " "الخادم. هذا النوع من الوظائف يسمح لخادم الملفات في مساحة المستخدم بالعمل " "بطريقة عديمة الحالة فيما يتعلق بالملفات التي يخدمها." #. commit bcda76524cd1fa32af748536f27f674a13e56700 #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "If I refers to a symbolic link and I does not specify " "B, then B() 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() with the B " "flag, and then passing the file descriptor as the I argument in " "system calls such as B(2) and B(2)." msgstr "" "إذا كان I يشير إلى رابط رمزي و I لا يحدد B، " "فإن B() تُرجع مقبضًا للرابط (بدلاً من الملف الذي يشير " "إليه). يمكن للعملية التي تستلم المقبض لاحقًا تنفيذ عمليات على الرابط الرمزي " "عن طريق تحويل المقبض إلى واصف ملف باستخدام B() مع العلم " "B، ثم تمرير واصف الملف كوسيطة I في استدعاءات النظام مثل " "B(2) و B(2)." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Obtaining a persistent filesystem ID" msgstr "الحصول على معرف نظام ملفات دائم" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The mount IDs in I can be reused as filesystems are " "unmounted and mounted. Therefore, the mount ID returned by " "B() (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 record that " "corresponds to the mount ID to derive a persistent identifier." msgstr "" "يمكن إعادة استخدام معرفات التوصيل في I عند فصل وتوصيل " "أنظمة الملفات. لذلك، لا ينبغي التعامل مع معرف التوصيل الذي تُرجعه " "B() (في I<*mount_id>) كمعرف دائم لنظام الملفات المُوصَّل " "المقابل. ومع ذلك، يمكن للتطبيق استخدام المعلومات في سجل I الذي " "يتوافق مع معرف التوصيل لاستخلاص معرف دائم." #. e.g., http://stackoverflow.com/questions/6748429/using-libblkid-to-find-uuid-of-a-partition #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For example, one can use the device name in the fifth field of the " "I record to search for the corresponding device UUID via the " "symbolic links in I. (A more comfortable way of " "obtaining the UUID is to use the B(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 " "argument used by B()." msgstr "" "على سبيل المثال، يمكن استخدام اسم الجهاز في الحقل الخامس من سجل I " "للبحث عن UUID الجهاز المقابل عبر الروابط الرمزية في I. " "(طريقة أكثر راحة للحصول على UUID هي استخدام مكتبة B(3).) يمكن بعد " "ذلك عكس تلك العملية، باستخدام UUID للبحث عن اسم الجهاز، ثم الحصول على نقطة " "التوصيل المقابلة، لإنتاج وسيطة I التي تستخدمها " "B()." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "أمثلة" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The two programs below demonstrate the use of B() and " "B(). The first program (I) uses " "B() 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() و " "B(). يستخدم البرنامج الأول (I) " "B() للحصول على مقبض ملف ومعرف وصل للملف المحدد في وسيط " "سطر الأوامر؛ ويُكتب المقبض ومعرف الوصل إلى المخرج القياسي." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The second program (I) reads a mount ID and file " "handle from standard input. The program then employs " "B() to open the file using that handle. If an optional " "command-line argument is supplied, then the I argument for " "B() is obtained by opening the directory named in that " "argument. Otherwise, I is obtained by scanning I 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) معرف توصيل ومقبض ملف من " "الإدخال القياسي. ثم يستخدم البرنامج B() لفتح الملف " "باستخدام ذلك المقبض. إذا تم توفير وسيطة اختيارية في سطر الأوامر، فسيتم " "الحصول على وسيطة I لـ B() عن طريق فتح الدليل " "المسمى في تلك الوسيطة. بخلاف ذلك، يتم الحصول على I عن طريق مسح I للعثور على سجل يتطابق معرف التوصيل فيه مع معرف التوصيل " "المقروء من الإدخال القياسي، ويتم فتح دليل التوصيل المحدد في ذلك السجل. (لا " "تتعامل هذه البرامج مع حقيقة أن معرفات التوصيل ليست دائمة.)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The following shell session demonstrates the use of these two programs:" msgstr "توضح جلسة الصدفة التالية استخدام هذين البرنامجين:" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "$B< echo \\[aq]Can you please think about it?\\[aq] E cecilia.txt>;\n" "$B< ./t_name_to_handle_at cecilia.txt E fh>;\n" "$B< ./t_open_by_handle_at E fh>;\n" "open_by_handle_at: Operation not permitted\n" "$B< sudo ./t_open_by_handle_at E fh>; # Need CAP_SYS_ADMIN\n" "Read 31 bytes\n" "$B< rm cecilia.txt>;\n" msgstr "" "$B< echo \\[aq]Can you please think about it?\\[aq] E cecilia.txt>;\n" "$B< ./t_name_to_handle_at cecilia.txt E fh>;\n" "$B< ./t_open_by_handle_at E fh>;\n" "open_by_handle_at: Operation not permitted\n" "$B< sudo ./t_open_by_handle_at E fh>; # Need 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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() recognizes that the original file referred to by the " "file handle no longer exists." msgstr "" "الآن نحذف الملف ونعيد إنشاءه (بسرعة) بحيث يكون له نفس المحتوى و (بالصدفة) " "نفس العقدة. ومع ذلك، تتعرف B() على أن الملف الأصلي " "المشار إليه بواسطة مقبض الملف لم يعد موجودًا." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Display inode number\n" "4072121\n" "$B< rm cecilia.txt>;\n" "$B< echo \\[aq]Can you please think about it?\\[aq] E cecilia.txt>;\n" "$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Check inode number\n" "4072121\n" "$B< sudo ./t_open_by_handle_at E fh>;\n" "open_by_handle_at: Stale NFS file handle\n" msgstr "" "$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Display inode number\n" "4072121\n" "$B< rm cecilia.txt>;\n" "$B< echo \\[aq]Can you please think about it?\\[aq] E cecilia.txt>;\n" "$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Check inode number\n" "4072121\n" "$B< sudo ./t_open_by_handle_at E fh>;\n" "open_by_handle_at: Stale NFS file handle\n" #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Efcntl.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int mount_id, fhsize, flags, dirfd;\n" " char *path;\n" " struct file_handle *fhp;\n" "\\&\n" " if (argc != 2) {\n" " fprintf(stderr, \"Usage: %s path\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " path = 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-Ehandle_bytes = 0;\n" " if (name_to_handle_at(dirfd, path, fhp, &mount_id, flags) != -1\n" " || errno != EOVERFLOW)\n" " {\n" " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\[rs]n\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Reallocate file_handle structure with correct size. */\n" "\\&\n" " fhsize = sizeof(*fhp) + fhp-Ehandle_bytes;\n" " fhp = realloc(fhp, fhsize); /* Copies fhp-Ehandle_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, path, 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\\[rs]n\", mount_id);\n" " printf(\"%u %d \", fhp-Ehandle_bytes, fhp-Ehandle_type);\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " printf(\" %02x\", fhp-Ef_handle[j]);\n" " printf(\"\\[rs]n\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Efcntl.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int mount_id, fhsize, flags, dirfd;\n" " char *path;\n" " struct file_handle *fhp;\n" "\\&\n" " if (argc != 2) {\n" " fprintf(stderr, \"Usage: %s path\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " path = 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-Ehandle_bytes = 0;\n" " if (name_to_handle_at(dirfd, path, fhp, &mount_id, flags) != -1\n" " || errno != EOVERFLOW)\n" " {\n" " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\[rs]n\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Reallocate file_handle structure with correct size. */\n" "\\&\n" " fhsize = sizeof(*fhp) + fhp-Ehandle_bytes;\n" " fhp = realloc(fhp, fhsize); /* Copies fhp-Ehandle_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, path, 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\\[rs]n\", mount_id);\n" " printf(\"%u %d \", fhp-Ehandle_bytes, fhp-Ehandle_type);\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " printf(\" %02x\", fhp-Ef_handle[j]);\n" " printf(\"\\[rs]n\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. SRC END #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/types.hE\n" "#include Eunistd.hE\n" "\\&\n" "#define streq(...) (strcmp(__VA_ARGS__) == 0)\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()\\[rs]n\");\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\\[rs]n\");\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 1 && streq(argv[1], \"--help\")) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Standard input contains mount ID and file handle information:\n" "\\&\n" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\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\\[rs]n\");\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-Ehandle_bytes = handle_bytes;\n" "\\&\n" " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" "\\&\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_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 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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/types.hE\n" "#include Eunistd.hE\n" "\\&\n" "#define streq(...) (strcmp(__VA_ARGS__) == 0)\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()\\[rs]n\");\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\\[rs]n\");\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 1 && streq(argv[1], \"--help\")) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Standard input contains mount ID and file handle information:\n" "\\&\n" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\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\\[rs]n\");\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-Ehandle_bytes = handle_bytes;\n" "\\&\n" " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" "\\&\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_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 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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. SRC END #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "انظر أيضًا" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B(2), B(3), B(8), B(8), B(8)" msgstr "B(2)،‏ B(3)،‏ B(8)،‏ B(8)،‏ B(8)" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "The I and I documentation in the latest I " "release at E<.UR https:\\://www.kernel.org/pub/linux/utils/util-linux/> E<." "UE>" msgstr "" "وثائق I و I في أحدث إصدار من I على E<.UR " "https:\\://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>" #. type: TH #: debian-trixie #, no-wrap msgid "2024-06-15" msgstr "15 يونيو 2024" #. type: TH #: debian-trixie #, no-wrap msgid "Linux man-pages 6.9.1" msgstr "صفحات دليل لينكس 6.9.1" #. type: Plain text #: debian-trixie msgid "Standard C library (I, I<-lc>)" msgstr "مكتبة سي المعيارية (I، I<-lc>)" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "BIB<, const char *>IB<,>\n" "B< struct file_handle *>IB<,>\n" "B< int *>IB<, int >IB<);>\n" "BIB<, struct file_handle *>IB<,>\n" "B< int >IB<);>\n" msgstr "" "BIB<, const char *>IB<,>\n" "B< struct file_handle *>IB<,>\n" "B< int *>IB<, int >IB<);>\n" "BIB<, struct file_handle *>IB<,>\n" "B< int >IB<);>\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "The B() system call returns a file handle and a mount ID " "corresponding to the file specified by the I and I " "arguments. The file handle is returned via the argument I, which is " "a pointer to a structure of the following form:" msgstr "" "يُعيد استدعاء النظام B() مقبض ملف ومعرف وصل (mount ID) " "يقابل الملف المحدد عبر معطيات I و I. يُعاد مقبض الملف عبر " "المعطى I، وهو مؤشر إلى بنية بالشكل التالي:" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "The I argument is a bit mask constructed by ORing together zero or " "more of B, B, and B, " "described below." msgstr "" "المعطى I هو قناع بتات (bit mask) يُبنى عبر إجراء عملية OR لصفر أو أكثر " "من القيم B، و B، و B، " "الموصوفة أدناه." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "Together, the I and I arguments identify the file for which " "a handle is to be obtained. There are four distinct cases:" msgstr "" "يحدد المعطيان I و I معًا الملف المراد الحصول على مقبض له. " "هناك أربع حالات متميزة:" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "If I 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 is ignored." msgstr "" "إذا كان I سلسلة نصية غير فارغة تحتوي على مسار مطلق، فيُعاد مقبض " "للملف الذي يشير إليه ذلك المسار. في هذه الحالة، يُتجاهل I." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "If I is a nonempty string containing a relative pathname and " "I has the special value B, then I 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 سلسلة نصية غير فارغة تحتوي على مسار نسبي وكان لـ " "I القيمة الخاصة B، فسيُفسر I نسبةً إلى دليل العمل " "الحالي لـ I<المستدعِي>، ويُعاد مقبض للملف الذي يشير إليه." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "If I is a nonempty string containing a relative pathname and " "I is a file descriptor referring to a directory, then I is " "interpreted relative to the directory referred to by I, and a handle " "is returned for the file to which it refers. (See B(2) for an " "explanation of why \"directory file descriptors\" are useful.)" msgstr "" "إذا كان I سلسلة نصية غير فارغة تحتوي على مسار نسبي وكان I " "واصف ملف يشير إلى دليل، فسيُفسر I نسبةً إلى الدليل الذي يشير إليه " "I، ويُعاد مقبض للملف الذي يشير إليه. (راجع B(2) لشرح سبب فائدة " "\"واصفات ملفات الدليل\".)" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "If I is an empty string and I specifies the value " "B, then I can be an open file descriptor referring to " "any type of file, or B, meaning the current working directory, and " "a handle is returned for the file to which it refers." msgstr "" "إذا كان I سلسلة فارغة وحددت I القيمة B، " "فيمكن لـ I أن يكون واصف ملف مفتوح يشير إلى أي نوع من الملفات، أو " "B (بمعنى دليل العمل الحالي)، ويُعاد مقبض للملف الذي يشير إليه." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "The I argument returns an identifier for the filesystem mount that " "corresponds to I. This corresponds to the first field in one of " "the records in I. 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(). " "I is returned both for a successful call and for a call that " "results in the error B." msgstr "" "يُعيد المعطى I معرفًا لوصل نظام الملفات الذي يقابل I. وهذا " "يقابل الحقل الأول في أحد السجلات في I. ويؤدي فتح " "المسار الموجود في الحقل الخامس من ذلك السجل إلى الحصول على واصف ملف لنقطة " "الوصل؛ يمكن استخدام واصف الملف هذا في استدعاء لاحق لـ " "B(). يُعاد I في حال نجاح الاستدعاء وأيضًا في حال " "الاستدعاء الذي ينتج عنه الخطأ B." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "By default, B() does not dereference I if it " "is a symbolic link, and thus returns a handle for the link itself. If " "B is specified in I, I 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() الارتباط التشعبي في I إذا " "كان رابطًا رمزيًا، وبالتالي يُعيد مقبضًا للرابط نفسه. أما إذا حُددت " "B في I، فيُتَّبع الرابط إذا كان رابطًا رمزيًا (بحيث " "يُعيد الاستدعاء مقبضًا للملف الذي يشير إليه الرابط)." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "I, I, or I points outside your accessible " "address space." msgstr "" "يشير I أو I أو I إلى خارج فضاء العناوين الذي " "يمكنك الوصول إليه." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "I includes an invalid bit value." msgstr "تتضمن I قيمة بت غير صالحة." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "I is an empty string, but B was not specified in " "I." msgstr "" "المسار I سلسلة فارغة، لكن لم تُحدد B في I." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "The file descriptor supplied in I does not refer to a directory, and " "it is not the case that both I includes B and " "I is an empty string." msgstr "" "واصف الملف المزود في I لا يشير إلى دليل، وليست الحالة هي تضمن " "I لـ B وكون I سلسلة فارغة معًا." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "I is relative but I is neither B nor a valid file " "descriptor." msgstr "" "مسار الملف I نسبي ولكن I ليس B ولا واصف ملف صالح." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "The specified I 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 was acquired using the B flag and the " "filesystem does not support B()." msgstr "" "المقبض I المحدد غير صالح لفتح ملف. يحدث هذا الخطأ إذا حُذف الملف " "مثلًا. يمكن أن يحدث هذا الخطأ أيضًا إذا استُحصل على I باستخدام علامة " "B وكان نظام الملفات لا يدعم B()." #. commit bcda76524cd1fa32af748536f27f674a13e56700 #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "If I refers to a symbolic link and I does not specify " "B, then B() 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() with the B " "flag, and then passing the file descriptor as the I argument in " "system calls such as B(2) and B(2)." msgstr "" "إذا كان I يشير إلى رابط رمزي ولم تحدد I القيمة " "B، فإن B() يُعيد مقبضًا للرابط (بدلًا من " "الملف الذي يشير إليه). يمكن للعملية التي تستلم المقبض إجراء عمليات لاحقًا على " "الرابط الرمزي عبر تحويل المقبض إلى واصف ملف باستخدام B() " "مع علامة B، ثم تمرير واصف الملف كمعطى I في استدعاءات النظام " "مثل B(2) و B(2)." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "$ B cecilia.txt>\n" "$ B<./t_name_to_handle_at cecilia.txt E fh>\n" "$ B<./t_open_by_handle_at E fh>\n" "open_by_handle_at: Operation not permitted\n" "$ B fh> # Need CAP_SYS_ADMIN\n" "Read 31 bytes\n" "$ B\n" msgstr "" "$ B cecilia.txt>\n" "$ B<./t_name_to_handle_at cecilia.txt E fh>\n" "$ B<./t_open_by_handle_at E fh>\n" "open_by_handle_at: Operation not permitted\n" "$ B fh> # Need CAP_SYS_ADMIN\n" "Read 31 bytes\n" "$ B\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "$ B # Display inode number\n" "4072121\n" "$ B\n" "$ B cecilia.txt>\n" "$ B # Check inode number\n" "4072121\n" "$ B fh>\n" "open_by_handle_at: Stale NFS file handle\n" msgstr "" "$ B # Display inode number\n" "4072121\n" "$ B\n" "$ B cecilia.txt>\n" "$ B # Check inode number\n" "4072121\n" "$ B fh>\n" "open_by_handle_at: Stale NFS file handle\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Efcntl.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\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\\[rs]n\", 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-Ehandle_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()\\[rs]n\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Reallocate file_handle structure with correct size. */\n" "\\&\n" " fhsize = sizeof(*fhp) + fhp-Ehandle_bytes;\n" " fhp = realloc(fhp, fhsize); /* Copies fhp-Ehandle_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\\[rs]n\", mount_id);\n" " printf(\"%u %d \", fhp-Ehandle_bytes, fhp-Ehandle_type);\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " printf(\" %02x\", fhp-Ef_handle[j]);\n" " printf(\"\\[rs]n\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Efcntl.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\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\\[rs]n\", 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-Ehandle_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()\\[rs]n\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Reallocate file_handle structure with correct size. */\n" "\\&\n" " fhsize = sizeof(*fhp) + fhp-Ehandle_bytes;\n" " fhp = realloc(fhp, fhsize); /* Copies fhp-Ehandle_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\\[rs]n\", mount_id);\n" " printf(\"%u %d \", fhp-Ehandle_bytes, fhp-Ehandle_type);\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " printf(\" %02x\", fhp-Ef_handle[j]);\n" " printf(\"\\[rs]n\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/types.hE\n" "#include Eunistd.hE\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()\\[rs]n\");\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\\[rs]n\");\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 1 && strcmp(argv[1], \"--help\") == 0) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Standard input contains mount ID and file handle information:\n" "\\&\n" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\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\\[rs]n\");\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-Ehandle_bytes = handle_bytes;\n" "\\&\n" " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" "\\&\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_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 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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/types.hE\n" "#include Eunistd.hE\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()\\[rs]n\");\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\\[rs]n\");\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 1 && strcmp(argv[1], \"--help\") == 0) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Standard input contains mount ID and file handle information:\n" "\\&\n" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\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\\[rs]n\");\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-Ehandle_bytes = handle_bytes;\n" "\\&\n" " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" "\\&\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_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 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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "The I and I documentation in the latest I " "release at E<.UR https://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>" msgstr "" "وثائق I و I في أحدث إصدار من I على E<.UR " "https://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "2024-07-23" msgstr "23 يوليو 2024" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "Linux man-pages 6.13" msgstr "صفحات دليل لينكس 6.13" #. type: TH #: mageia-cauldron #, no-wrap msgid "2026-02-08" msgstr "8 فبراير 2026" #. type: TH #: mageia-cauldron #, no-wrap msgid "Linux man-pages 6.17" msgstr "صفحات دليل لينكس 6.17" #. type: Plain text #: mageia-cauldron #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/types.hE\n" "#include Eunistd.hE\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()\\[rs]n\");\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\\[rs]n\");\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 1 && strcmp(argv[1], \"--help\") == 0) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Standard input contains mount ID and file handle information:\n" "\\&\n" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\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\\[rs]n\");\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-Ehandle_bytes = handle_bytes;\n" "\\&\n" " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" "\\&\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_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 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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Esys/types.hE\n" "#include Eunistd.hE\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()\\[rs]n\");\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\\[rs]n\");\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 1 && strcmp(argv[1], \"--help\") == 0) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Standard input contains mount ID and file handle information:\n" "\\&\n" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\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\\[rs]n\");\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-Ehandle_bytes = handle_bytes;\n" "\\&\n" " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" "\\&\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_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 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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: TH #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Linux man-pages (unreleased)" msgstr "صفحات دليل لينكس (لم تصدر بعد)"