# Arabic translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # زايد السعيدي , 2026. #, fuzzy msgid "" msgstr "" "Project-Id-Version: manpages-l10n\n" "POT-Creation-Date: 2026-06-05 06:23+0200\n" "PO-Revision-Date: 2026-06-27 17:58+0200\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" ".MIME-Version: 1.0\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 "epoll" msgstr "epoll" #. type: TH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "2026-02-08" msgstr "8 فبراير 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 "epoll - I/O event notification facility" msgstr "epoll - مرفق إعلام أحداث الإدخال/الإخراج" #. 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<#include Esys/epoll.hE>\n" msgstr "B<#include Esys/epoll.hE>\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 API performs a similar task to B(2): monitoring multiple " "file descriptors to see if I/O is possible on any of them. The B API " "can be used either as an edge-triggered or a level-triggered interface and " "scales well to large numbers of watched file descriptors." msgstr "" "تقوم واجهة برمجة التطبيقات B بمهمة مشابهة لـ B(2): مراقبة " "واصفات ملفات متعددة لمعرفة ما إذا كان الإدخال/الإخراج ممكنًا على أي منها. " "يمكن استخدام واجهة برمجة التطبيقات B إما كواجهة محفزة بالحافة أو " "محفزة بالمستوى وتتوسع جيدًا لأعداد كبيرة من واصفات الملفات المراقبة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The central concept of the B API is the B I, an in-" "kernel data structure which, from a user-space perspective, can be " "considered as a container for two lists:" msgstr "" "المفهوم المركزي لواجهة برمجة التطبيقات B هو I<مثيل> B، وهو " "بنية بيانات داخل النواة يمكن، من منظور مساحة المستخدم، اعتبارها حاوية " "لقائمتين:" #. 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-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The I list (sometimes also called the B set): the set of " "file descriptors that the process has registered an interest in monitoring." msgstr "" "قائمة 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 list: the set of file descriptors that are \"ready\" for I/O. " "The ready list is a subset of (or, more precisely, a set of references to) " "the file descriptors in the interest list. The ready list is dynamically " "populated by the kernel as a result of I/O activity on those file " "descriptors." msgstr "" "قائمة I<الجاهزية>: مجموعة واصفات الملفات \"الجاهزة\" للإدخال/الإخراج. قائمة " "الجاهزية هي مجموعة فرعية من (أو، بشكل أكثر دقة، مجموعة مراجع لـ) واصفات " "الملفات في قائمة الاهتمام. تُملئ قائمة الجاهزية ديناميكيًا بواسطة النواة نتيجة " "لنشاط الإدخال/الإخراج على واصفات الملفات تلك." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The following system calls are provided to create and manage an B " "instance:" msgstr "تُوفر استدعاءات النظام التالية لإنشاء وإدارة مثيل B:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B(2) creates a new B instance and returns a file " "descriptor referring to that instance. (The more recent " "B(2) extends the functionality of B(2).)" msgstr "" "يقوم B(2) بإنشاء مثيل B جديد ويعيد واصف ملف يشير إلى " "ذلك المثيل. (يقوم B(2) الأحدث بتوسيع وظائف " "B(2).)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Interest in particular file descriptors is then registered via " "B(2), which adds items to the interest list of the B " "instance." msgstr "" "ثم يُسجل الاهتمام بواصفات ملفات معينة عبر B(2)، الذي يضيف عناصر " "إلى قائمة الاهتمام لمثيل B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B(2) waits for I/O events, blocking the calling thread if no " "events are currently available. (This system call can be thought of as " "fetching items from the ready list of the B instance.)" msgstr "" "ينتظر B(2) أحداث الإدخال/الإخراج، مما يحجب الخيط المستدعي إذا لم " "تكن أي أحداث متاحة حاليًا. (يمكن اعتبار استدعاء النظام هذا كجلب عناصر من " "قائمة الجاهزية لمثيل B.)" #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Level-triggered and edge-triggered" msgstr "محفز بالمستوى ومحفز بالحافة" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B event distribution interface is able to behave both as edge-" "triggered (ET) and as level-triggered (LT). The difference between the two " "mechanisms can be described as follows. Suppose that this scenario happens:" msgstr "" "واجهة توزيع الأحداث B قادرة على التصرف كمحفز بالحافة (ET) ومحفز " "بالمستوى (LT). يمكن وصف الفرق بين الآليتين على النحو التالي. افترض أن هذا " "السيناريو يحدث:" #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "(1)" msgstr "(1)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The file descriptor that represents the read side of a pipe (I) is " "registered on the B instance." msgstr "" "يُسجل واصف الملف الذي يمثل جانب القراءة من أنبوب (I) على مثيل B." #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "(2)" msgstr "(2)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "A pipe writer writes 2\\ kB of data on the write side of the pipe." msgstr "" "يكتب كاتب الأنبوب 2\\ كيلوبايت من البيانات على جانب الكتابة من الأنبوب." #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "(3)" msgstr "(3)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A call to B(2) is done that will return I as a ready file " "descriptor." msgstr "يُستدعى B(2) الذي سيعيد I كواصف ملف جاهز." #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "(4)" msgstr "(4)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The pipe reader reads 1\\ kB of data from I." msgstr "يقرأ قارئ الأنبوب 1\\ كيلوبايت من البيانات من I." #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "(5)" msgstr "(5)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "A call to B(2) is done." msgstr "يُستدعى B(2)." #. type: Plain text #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "" "If the I file descriptor has been added to the B interface using " "the B (edge-triggered) flag, the call to B(2) done in " "step B<5> will probably hang despite the available data still present in the " "file input buffer; meanwhile the remote peer might be expecting a response " "based on the data it already sent. The reason for this is that edge-" "triggered mode delivers events only when changes occur on the monitored file " "descriptor, that is, an event will be generated upon each receipt of a chunk " "of data. So, in step B<5> the caller might end up waiting for some data " "that is already present inside the input buffer. In the above example, an " "event on I will be generated because of the write done in B<2> and the " "event is consumed in B<3>. Since the read operation done in B<4> does not " "consume the whole buffer data, the call to B(2) done in step " "B<5> might block indefinitely." msgstr "" "إذا أُضيف واصف الملف I إلى واجهة B باستخدام العلم B " "(محفز بالحافة)، فإن استدعاء B(2) الذي تم في الخطوة B<5> سيعلق " "على الأرجح على الرغم من البيانات المتاحة الموجودة في مخزن الإدخال المؤقت " "للملف؛ وفي الوقت نفسه، قد يتوقع النظير البعيد استجابة بناءً على البيانات التي " "أرسلها بالفعل. السبب في ذلك هو أن الوضع المحفز بالحافة يسلم الأحداث فقط عند " "حدوث تغييرات على واصف الملف المراقب، أي أنه يُولّد حدث عند كل استلام لكتلة من " "البيانات. لذا، في الخطوة B<5> قد ينتهي الأمر بالمستدعي بانتظار بعض البيانات " "الموجودة بالفعل داخل مخزن الإدخال المؤقت. في المثال أعلاه، سيُولّد حدث على " "I بسبب الكتابة التي تمت في B<2> ويُستهلك الحدث في B<3>. نظرًا لأن عملية " "القراءة التي تمت في B<4> لا تستهلك بيانات المخزن المؤقت بالكامل، فإن استدعاء " "B(2) الذي تم في الخطوة B<5> قد يحظر إلى أجل غير مسمى." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "An application that employs the B flag should use nonblocking file " "descriptors to avoid having a blocking read or write starve a task that is " "handling multiple file descriptors. The suggested way to use B as an " "edge-triggered (B) interface is as follows:" msgstr "" "يجب على تطبيق يستخدم العلم B استخدام واصفات ملفات غير محظورة لتجنب " "تجويع مهمة تتعامل مع واصفات ملفات متعددة بسبب قراءة أو كتابة محظورة. الطريقة " "المقترحة لاستخدام B كواجهة محفزة بالحافة (B) هي كما يلي:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "with nonblocking file descriptors; and" msgstr "مع واصفات ملفات غير محظورة؛ و" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "by waiting for an event only after B(2) or B(2) return " "B." msgstr "بانتظار حدث فقط بعد أن يعيد B(2) أو B(2) B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "By contrast, when used as a level-triggered interface (the default, when " "B is not specified), B is simply a faster B(2), and " "can be used wherever the latter is used since it shares the same semantics." 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 "" "Since even with edge-triggered B, multiple events can be generated " "upon receipt of multiple chunks of data, the caller has the option to " "specify the B flag, to tell B to disable the associated " "file descriptor after the receipt of an event with B(2). When " "the B flag is specified, it is the caller's responsibility to " "rearm the file descriptor using B(2) with B." msgstr "" "نظرًا لأنه حتى مع B المحفز بالحافة، يمكن توليد أحداث متعددة عند استلام " "كتل متعددة من البيانات، فإن لدى المستدعي خيار تحديد العلم B، " "لإخبار B بتعطيل واصف الملف المرتبط بعد استلام حدث مع " "B(2). عند تحديد العلم B، تقع على عاتق المستدعي " "مسؤولية إعادة تسليح واصف الملف باستخدام B(2) مع B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "If multiple threads (or processes, if child processes have inherited the " "B file descriptor across B(2)) are blocked in " "B(2) waiting on the same epoll file descriptor and a file " "descriptor in the interest list that is marked for edge-triggered " "(B) notification becomes ready, just one of the threads (or " "processes) is awoken from B(2). This provides a useful " "optimization for avoiding \"thundering herd\" wake-ups in some scenarios." msgstr "" "إذا حُظر تعدد الخيوط (أو عمليات، إذا ورثت العمليات الفرعية واصف ملف B " "عبر B(2)) في B(2) منتظرة نفس واصف ملف epoll وأصبح واصف ملف " "في قائمة الاهتمام محدد للإعلام المحفز بالحافة (B) جاهزًا، يُوقظ خيط " "واحد فقط (أو عملية) من B(2). يوفر هذا تحسينًا مفيدًا لتجنب إيقاظ " "\"القطيع المتدافع\" في بعض السيناريوهات." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Interaction with autosleep" msgstr "التفاعل مع التعليق الآلي" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "If the system is in B mode via I and an " "event happens which wakes the device from sleep, the device driver will keep " "the device awake only until that event is queued. To keep the device awake " "until the event has been processed, it is necessary to use the " "B(2) B flag." msgstr "" "إذا كان النظام في وضع B عبر I وحدث حدث يوقظ " "الجهاز من التعليق؛ فسيُبقي برنامج تشغيل الجهاز الجهاز مستيقظًا فقط حتى يُوضع " "ذلك الحدث في قائمة الانتظار. لإبقاء الجهاز مستيقظًا حتى يُعالج الحدث، من " "الضروري استخدام علامة B(2) B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "When the B flag is set in the B field for a I, the system will be kept awake from the moment the event is " "queued, through the B(2) call which returns the event until the " "subsequent B(2) call. If the event should keep the system " "awake beyond that time, then a separate I should be taken before " "the second B(2) call." msgstr "" "عند تعيين علامة B في حقل B لـ I، " "سيُبقي النظام مستيقظًا من لحظة وضع الحدث في قائمة الانتظار، عبر استدعاء " "B(2) الذي يُرجع الحدث حتى استدعاء B(2) التالي. إذا " "كان يجب أن يُبقي الحدث النظام مستيقظًا بعد ذلك الوقت، فيجب أخذ I " "منفصل قبل استدعاء B(2) الثاني." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "/proc interfaces" msgstr "واجهات /proc" #. Following was added in Linux 2.6.28, but them removed in Linux 2.6.29 #. .TP #. .IR /proc/sys/fs/epoll/max_user_instances " (since Linux 2.6.28)" #. This specifies an upper limit on the number of epoll instances #. that can be created per real user ID. #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The following interfaces can be used to limit the amount of kernel memory " "consumed by epoll:" msgstr "" "يمكن استخدام الواجهات التالية للحد من مقدار ذاكرة النواة التي يستهلكها epoll:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "I (since Linux 2.6.28)" msgstr "I (منذ Linux 2.6.28)" #. Linux 2.6.29 (in Linux 2.6.28, the default was 1/32 of lowmem) #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This specifies a limit on the total number of file descriptors that a user " "can register across all epoll instances on the system. The limit is per " "real user ID. Each registered file descriptor costs roughly 90 bytes on a " "32-bit kernel, and roughly 160 bytes on a 64-bit kernel. Currently, the " "default value for I is 1/25 (4%) of the available low " "memory, divided by the registration cost in bytes." msgstr "" "يحدد هذا حدًا للعدد الإجمالي لوصفات الملفات التي يمكن لمستخدم تسجيلها عبر " "جميع مثيلات epoll على النظام. الحد هو لكل معرف مستخدم حقيقي. تكلف كل واصف " "ملف مسجل حوالي 90 بايت على نواة 32 بت، وحوالي 160 بايت على نواة 64 بت. " "حاليًا، القيمة المبدئية لـ I هي 1/25 (4%) من الذاكرة " "المنخفضة المتاحة، مقسومة على تكلفة التسجيل بالبايت." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Example for suggested usage" msgstr "مثال للاستخدام المقترح" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "While the usage of B when employed as a level-triggered interface " "does have the same semantics as B(2), the edge-triggered usage " "requires more clarification to avoid stalls in the application event loop. " "In this example, listener is a nonblocking socket on which B(2) has " "been called. The function I uses the new ready file descriptor " "until B is returned by either B(2) or B(2). An event-" "driven state machine application should, after having received B, " "record its current state so that at the next call to I it will " "continue to B(2) or B(2) from where it stopped before." msgstr "" "بينما استخدام B عند توظيفه كواجهة محفزة بالمستوى له نفس دلالات " "B(2)، فإن الاستخدام المحفز بالحافة يتطلب مزيدًا من التوضيح لتجنب التوقف " "في حلقة أحداث التطبيق. في هذا المثال، المستمع هو مقبس غير محظور اُستدعيت " "B(2) عليه. تستخدم الدالة I واصف الملف الجديد الجاهز " "حتى يُرجع B بواسطة إما B(2) أو B(2). يجب على تطبيق آلة " "الحالة الموجه بالأحداث، بعد استلام B، تسجيل حالته الحالية بحيث في " "الاستدعاء التالي لـ I سيستمر في B(2) أو B(2) من " "حيث توقف سابقًا." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "#define MAX_EVENTS 10\n" "struct epoll_event ev, events[MAX_EVENTS];\n" "int listen_sock, conn_sock, nfds, epollfd;\n" "\\&\n" "/* Code to set up listening socket, \\[aq]listen_sock\\[aq],\n" " (socket(), bind(), listen()) omitted. */\n" "\\&\n" "epollfd = epoll_create1(0);\n" "if (epollfd == -1) {\n" " perror(\"epoll_create1\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "ev.events = EPOLLIN;\n" "ev.data.fd = listen_sock;\n" "if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == -1) {\n" " perror(\"epoll_ctl: listen_sock\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "for (;;) {\n" " nfds = epoll_wait(epollfd, events, MAX_EVENTS, -1);\n" " if (nfds == -1) {\n" " perror(\"epoll_wait\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (n = 0; n E nfds; ++n) {\n" " if (events[n].data.fd == listen_sock) {\n" " conn_sock = accept(listen_sock,\n" " (struct sockaddr *) &addr, &addrlen);\n" " if (conn_sock == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" " setnonblocking(conn_sock);\n" " ev.events = EPOLLIN | EPOLLET;\n" " ev.data.fd = conn_sock;\n" " if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock,\n" " &ev) == -1) {\n" " perror(\"epoll_ctl: conn_sock\");\n" " exit(EXIT_FAILURE);\n" " }\n" " } else {\n" " do_use_fd(events[n].data.fd);\n" " }\n" " }\n" "}\n" msgstr "" "#define MAX_EVENTS 10\n" "struct epoll_event ev, events[MAX_EVENTS];\n" "int listen_sock, conn_sock, nfds, epollfd;\n" "\\&\n" "/* Code to set up listening socket, \\[aq]listen_sock\\[aq],\n" " (socket(), bind(), listen()) omitted. */\n" "\\&\n" "epollfd = epoll_create1(0);\n" "if (epollfd == -1) {\n" " perror(\"epoll_create1\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "ev.events = EPOLLIN;\n" "ev.data.fd = listen_sock;\n" "if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == -1) {\n" " perror(\"epoll_ctl: listen_sock\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "for (;;) {\n" " nfds = epoll_wait(epollfd, events, MAX_EVENTS, -1);\n" " if (nfds == -1) {\n" " perror(\"epoll_wait\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (n = 0; n E nfds; ++n) {\n" " if (events[n].data.fd == listen_sock) {\n" " conn_sock = accept(listen_sock,\n" " (struct sockaddr *) &addr, &addrlen);\n" " if (conn_sock == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" " setnonblocking(conn_sock);\n" " ev.events = EPOLLIN | EPOLLET;\n" " ev.data.fd = conn_sock;\n" " if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock,\n" " &ev) == -1) {\n" " perror(\"epoll_ctl: conn_sock\");\n" " exit(EXIT_FAILURE);\n" " }\n" " } else {\n" " do_use_fd(events[n].data.fd);\n" " }\n" " }\n" "}\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "When used as an edge-triggered interface, for performance reasons, it is " "possible to add the file descriptor inside the B interface " "(B) once by specifying (B|B). This " "allows you to avoid continuously switching between B and " "B calling B(2) with B." msgstr "" "عند استخدامه كواجهة محفزة بالحافة، لأسباب تتعلق بالأداء، من الممكن إضافة " "واصف الملف داخل واجهة B (B) مرة واحدة عن طريق تحديد " "(B|B). يتيح لك هذا تجنب التبديل المستمر بين B و " "B باستدعاء B(2) مع B." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Questions and answers" msgstr "أسئلة وأجوبة" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "What is the key used to distinguish the file descriptors registered in an " "interest list?" msgstr "" "ما هو المفتاح المستخدم للتمييز بين واصفات الملفات المسجلة في قائمة الاهتمام؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The key is the combination of the file descriptor number and the open file " "description (also known as an \"open file handle\", the kernel's internal " "representation of an open file)." msgstr "" "المفتاح هو مزيج من رقم واصف الملف ووصف الملف المفتوح (المعروف أيضًا باسم " "\"مقبض الملف المفتوح\"، التمثيل الداخلي للنواة لملف مفتوح)." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "What happens if you register the same file descriptor on an B " "instance twice?" msgstr "ماذا يحدث إذا سجلت نفس واصف الملف على مثيل B مرتين؟" # # #. But a file descriptor duplicated by fork(2) can't be added to the #. set, because the [file *, fd] pair is already in the epoll set. #. That is a somewhat ugly inconsistency. On the one hand, a child process #. cannot add the duplicate file descriptor to the epoll set. (In every #. other case that I can think of, file descriptors duplicated by fork have #. similar semantics to file descriptors duplicated by dup() and friends.) On #. the other hand, the very fact that the child has a duplicate of the #. file descriptor means that even if the parent closes its file descriptor, #. then epoll_wait() in the parent will continue to receive notifications for #. that file descriptor because of the duplicated file descriptor in the child. #. See http://thread.gmane.org/gmane.linux.kernel/596462/ #. "epoll design problems with common fork/exec patterns" #. mtk, Feb 2008 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "You will probably get B. However, it is possible to add a duplicate " "(B(2), B(2), B(2) B) file descriptor to the " "same B instance. This can be a useful technique for filtering " "events, if the duplicate file descriptors are registered with different " "I masks." msgstr "" "ستحصل على الأرجح على B. ومع ذلك، من الممكن إضافة واصف ملف مكرر " "(B(2), B(2), B(2) B) إلى نفس مثيل B. " "يمكن أن تكون هذه تقنية مفيدة لتصفية الأحداث، إذا سُجلت واصفات الملفات المكررة " "بأقنعة I مختلفة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Can two B instances wait for the same file descriptor? If so, are " "events reported to both B file descriptors?" msgstr "" "هل يمكن لمثيلين من B الانتظار لنفس واصف الملف؟ إذا كان الأمر كذلك، هل " "يُبلغ عن الأحداث لكلا واصفي ملف B؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Yes, and events would be reported to both. However, careful programming may " "be needed to do this correctly." msgstr "" "نعم، وسيُبلغ عن الأحداث لكليهما. ومع ذلك، قد تكون هناك حاجة إلى برمجة دقيقة " "للقيام بذلك بشكل صحيح." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Is the B file descriptor itself poll/epoll/selectable?" msgstr "هل واصف ملف B نفسه قابل للاستقصاء/epoll/الاختيار؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Yes. If an B file descriptor has events waiting, then it will " "indicate as being readable." msgstr "" "نعم. إذا كان واصف ملف B يحتوي على أحداث في انتظار، فسيشير إلى أنه " "قابل للقراءة." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "What happens if one attempts to put an B file descriptor into its own " "file descriptor set?" msgstr "" "ماذا يحدث إذا حاول المرء وضع واصف ملف B في مجموعة واصفات الملفات " "الخاصة به؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B(2) call fails (B). However, you can add an " "B file descriptor inside another B file descriptor set." msgstr "" "يفشل استدعاء B(2) (B). ومع ذلك، يمكنك إضافة واصف ملف " "B داخل مجموعة واصفات ملف B أخرى." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Can I send an B file descriptor over a UNIX domain socket to another " "process?" msgstr "هل يمكنني إرسال واصف ملف B عبر مقبس نطاق UNIX إلى عملية أخرى؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Yes, but it does not make sense to do this, since the receiving process " "would not have copies of the file descriptors in the interest list." msgstr "" "نعم، ولكن ليس من المنطقي القيام بذلك، لأن العملية المستقبلة لن يكون لديها " "نسخ من واصفات الملفات في قائمة الاهتمام." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Will closing a file descriptor cause it to be removed from all B " "interest lists?" msgstr "هل سيؤدي إغلاق واصف ملف إلى إزالته من جميع قوائم اهتمام B؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Yes, but be aware of the following point. A file descriptor is a reference " "to an open file description (see B(2)). Whenever a file descriptor is " "duplicated via B(2), B(2), B(2) B, or " "B(2), a new file descriptor referring to the same open file " "description is created. An open file description continues to exist until " "all file descriptors referring to it have been closed." msgstr "" "نعم، ولكن كن على دراية بالنقطة التالية. واصف الملف هو مرجع لوصف ملف مفتوح " "(انظر B(2)). كلما كُرر واصف ملف عبر B(2), B(2), " "B(2) B, أو B(2)، يُنشئ واصف ملف جديد يشير إلى نفس وصف " "الملف المفتوح. يستمر وصف الملف المفتوح في الوجود حتى تُغلق جميع واصفات " "الملفات التي تشير إليه." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A file descriptor is removed from an interest list only after all the file " "descriptors referring to the underlying open file description have been " "closed. This means that even after a file descriptor that is part of an " "interest list has been closed, events may be reported for that file " "descriptor if other file descriptors referring to the same underlying file " "description remain open. To prevent this happening, the file descriptor " "must be explicitly removed from the interest list (using B(2) " "B) before it is duplicated. Alternatively, the application " "must ensure that all file descriptors are closed (which may be difficult if " "file descriptors were duplicated behind the scenes by library functions that " "used B(2) or B(2))." msgstr "" "يُزال واصف الملف من قائمة الاهتمام فقط بعد إغلاق جميع واصفات الملفات التي " "تشير إلى وصف الملف المفتوح الأساسي. هذا يعني أنه حتى بعد إغلاق واصف ملف " "يمثل جزءًا من قائمة الاهتمام، قد يُبلغ عن أحداث لذلك واصف الملف إذا بقيت " "واصفات ملفات أخرى تشير إلى نفس وصف الملف الأساسي مفتوحة. لمنع حدوث ذلك، يجب " "إزالة واصف الملف صراحةً من قائمة الاهتمام (باستخدام B(2) " "B) قبل تكراره. بدلاً من ذلك، يجب على التطبيق التأكد من إغلاق " "جميع واصفات الملفات (والذي قد يكون صعبًا إذا كُررت واصفات الملفات خلف الكواليس " "بواسطة دوال مكتبة استخدمت B(2) أو B(2))." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "If more than one event occurs between B(2) calls, are they " "combined or reported separately?" msgstr "" "إذا حدث أكثر من حدث واحد بين استدعاءات B(2)، هل تُجمع أم يُبلغ " "عنها بشكل منفصل؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "They will be combined." msgstr "ستُجمع." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Does an operation on a file descriptor affect the already collected but not " "yet reported events?" msgstr "" "هل تؤثر عملية على واصف ملف على الأحداث المجموعة فعلًا ولكن لم يُبلغ عنها بعد؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "You can do two operations on an existing file descriptor. Remove would be " "meaningless for this case. Modify will reread available I/O." msgstr "" "يمكنك إجراء عمليتين على واصف ملف موجود. الإزالة ستكون غير ذات معنى لهذه " "الحالة. التعديل سيعيد قراءة الإدخال/الإخراج المتاح." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Do I need to continuously read/write a file descriptor until B when " "using the B flag (edge-triggered behavior)?" msgstr "" "هل أحتاج إلى القراءة/الكتابة باستمرار من واصف ملف حتى B عند استخدام " "علامة B (السلوك المحفز بالحافة)؟" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Receiving an event from B(2) should suggest to you that such " "file descriptor is ready for the requested I/O operation. You must consider " "it ready until the next (nonblocking) read/write yields B. When " "and how you will use the file descriptor is entirely up to you." msgstr "" "استلام حدث من B(2) يجب أن يشير لك أن واصف الملف هذا جاهز لعملية " "الإدخال/الإخراج المطلوبة. يجب أن تعتبره جاهزًا حتى تؤدي القراءة/الكتابة " "التالية (غير المحظورة) إلى B. متى وكيف ستستخدم واصف الملف يعود إليك " "بالكامل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For packet/token-oriented files (e.g., datagram socket, terminal in " "canonical mode), the only way to detect the end of the read/write I/O space " "is to continue to read/write until B." msgstr "" "بالنسبة للملفات الموجهة للحزم/الرموز (مثل مقبس البيانات، الطرفية في الوضع " "القانوني)، الطريقة الوحيدة لاكتشاف نهاية مساحة الإدخال/الإخراج للقراءة/" "الكتابة هي الاستمرار في القراءة/الكتابة حتى B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "For stream-oriented files (e.g., pipe, FIFO, stream socket), the condition " "that the read/write I/O space is exhausted can also be detected by checking " "the amount of data read from / written to the target file descriptor. For " "example, if you call B(2) by asking to read a certain amount of data " "and B(2) returns a lower number of bytes, you can be sure of having " "exhausted the read I/O space for the file descriptor. The same is true when " "writing using B(2). (Avoid this latter technique if you cannot " "guarantee that the monitored file descriptor always refers to a stream-" "oriented file.)" msgstr "" "بالنسبة للملفات الموجهة للتيار (مثل الأنبوب، FIFO، مقبس التيار)، يمكن أيضًا " "اكتشاف حالة استنفاد مساحة الإدخال/الإخراج للقراءة/الكتابة عن طريق التحقق من " "كمية البيانات المقروءة من / المكتوبة إلى واصف الملف الهدف. على سبيل المثال، " "إذا استدعيت B(2) لطلب قراءة كمية معينة من البيانات وأرجعت 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 "Possible pitfalls and ways to avoid them" msgstr "المزالق المحتملة وطرق تجنبها" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed 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 "" "If there is a large amount of I/O space, it is possible that by trying to " "drain it the other files will not get processed causing starvation. (This " "problem is not specific to 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 solution is to maintain a ready list and mark the file descriptor as " "ready in its associated data structure, thereby allowing the application to " "remember which files need to be processed but still round robin amongst all " "the ready files. This also supports ignoring subsequent events you receive " "for file descriptors that are already ready." msgstr "" "الحل هو الاحتفاظ بقائمة جاهزة ووضع علامة على واصف الملف كجاهز في بنية " "البيانات المرتبطة به، مما يسمح للتطبيق بتذكر الملفات التي تحتاج إلى معالجة " "ولكن مع الاستمرار في التناوب الدائري بين جميع الملفات الجاهزة. هذا يدعم أيضًا " "تجاهل الأحداث اللاحقة التي تستلمها لواصفات الملفات الجاهزة بالفعل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed 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 "" "If you use an event cache or store all the file descriptors returned from " "B(2), then make sure to provide a way to mark its closure " "dynamically (i.e., caused by a previous event's processing). Suppose you " "receive 100 events from B(2), and in event #47 a condition " "causes event #13 to be closed. If you remove the structure and B(2) " "the file descriptor for event #13, then your event cache might still say " "there are events waiting for that file descriptor causing confusion." msgstr "" "إذا كنت تستخدم خبيئة أحداث أو تخزن جميع واصفات الملفات المعادة من " "B(2)، فتأكد من توفير طريقة لوضع علامة على إغلاقها ديناميكيًا (أي " "ناتج عن معالجة حدث سابق). افترض أنك تستلم 100 حدث من B(2)، وفي " "الحدث #47 تسبب حالة في إغلاق الحدث #13. إذا أزلت البنية واستدعيت B(2) " "لواصف الملف للحدث #13، فقد تظل خبيئة الأحداث تقول أن هناك أحداثًا تنتظر واصف " "الملف هذا مما يسبب ارتباكًا." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "One solution for this is to call, during the processing of event 47, " "B(B) to delete file descriptor 13 and " "B(2), then mark its associated data structure as removed and link it " "to a cleanup list. If you find another event for file descriptor 13 in your " "batch processing, you will discover the file descriptor had been previously " "removed and there will be no confusion." msgstr "" "أحد الحلول لذلك هو استدعاء، أثناء معالجة الحدث 47، " "B(B) لحذف واصف الملف 13 و B(2)، ثم وضع " "علامة على بنية البيانات المرتبطة به كمزالة وربطها بقائمة تنظيف. إذا وجدت " "حدثًا آخر لواصف الملف 13 في معالجتك الدفعية، ستكتشف أن واصف الملف قد أزيل " "سابقًا ولن يكون هناك ارتباك." #. 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 "" "Some other systems provide similar mechanisms; for example, FreeBSD has " "I, and Solaris has I." msgstr "" "بعض الأنظمة الأخرى توفر آليات مماثلة؛ على سبيل المثال، FreeBSD لديها " "I، وSolaris لديها I." #. 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 "التاريخ" #. Its interface should be finalized in Linux 2.5.66. #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux 2.5.44. glibc 2.3.2." msgstr "لينكس 2.5.44. glibc 2.3.2." #. 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 "" "The set of file descriptors that is being monitored via an epoll file " "descriptor can be viewed via the entry for the epoll file descriptor in the " "process's IpidI directory. See B(5) for further " "details." msgstr "" "يمكن عرض مجموعة واصفات الملفات المُراقبة عبر واصف ملف epoll من خلال الإدخال " "الخاص بواصف ملف epoll في دليل IpidI للعملية. انظر " "B(5) لمزيد من التفاصيل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The B(2) B operation can be used to test whether a " "file descriptor is present in an epoll instance." msgstr "" "يمكن استخدام عملية B(2) B لاختبار ما إذا كان واصف ملف " "موجودًا في مثيل epoll." #. 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(2), B(2), B(2), " "B(2), B(2), B(2)" #. type: TH #: debian-trixie #, no-wrap msgid "2024-06-12" msgstr "12 يونيو 2024" #. type: TH #: debian-trixie #, no-wrap msgid "Linux man-pages 6.9.1" msgstr "صفحات دليل لينكس 6.9.1" #. type: Plain text #: debian-trixie msgid "" "If the I file descriptor has been added to the B interface using " "the B (edge-triggered) flag, the call to B(2) done in " "step B<5> will probably hang despite the available data still present in the " "file input buffer; meanwhile the remote peer might be expecting a response " "based on the data it already sent. The reason for this is that edge-" "triggered mode delivers events only when changes occur on the monitored file " "descriptor. So, in step B<5> the caller might end up waiting for some data " "that is already present inside the input buffer. In the above example, an " "event on I will be generated because of the write done in B<2> and the " "event is consumed in B<3>. Since the read operation done in B<4> does not " "consume the whole buffer data, the call to B(2) done in step " "B<5> might block indefinitely." msgstr "" "إذا أُضيف واصف الملف I إلى واجهة B باستخدام علامة B " "(محفز بالحافة)، فمن المحتمل أن يتعطل استدعاء B(2) الذي تم في " "الخطوة B<5> على الرغم من وجود البيانات المتاحة في مخزن الإدخال المؤقت للملف؛ " "في هذه الأثناء قد يتوقع النظير البعيد استجابة بناءً على البيانات التي أرسلها " "بالفعل. السبب في ذلك هو أن الوضع المحفز بالحافة يسلم الأحداث فقط عند حدوث " "تغييرات على واصف الملف المراقب. لذا، في الخطوة B<5> قد ينتهي الأمر بالمتصل " "بانتظار بعض البيانات الموجودة بالفعل داخل مخزن الإدخال المؤقت. في المثال " "أعلاه، سيُنشئ حدث على I بسبب الكتابة التي تمت في B<2> ويُستهلك الحدث في " "B<3>. نظرًا لأن عملية القراءة التي تمت في B<4> لا تستهلك بيانات المخزن المؤقت " "بالكامل، فقد يُحظر استدعاء B(2) الذي تم في الخطوة B<5> إلى أجل " "غير مسمى." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "#define MAX_EVENTS 10\n" "struct epoll_event ev, events[MAX_EVENTS];\n" "int listen_sock, conn_sock, nfds, epollfd;\n" "\\&\n" "/* Code to set up listening socket, \\[aq]listen_sock\\[aq],\n" " (socket(), bind(), listen()) omitted. */\n" "\\&\n" "epollfd = epoll_create1(0);\n" "if (epollfd == -1) {\n" " perror(\"epoll_create1\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "ev.events = EPOLLIN;\n" "ev.data.fd = listen_sock;\n" "if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == -1) {\n" " perror(\"epoll_ctl: listen_sock\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "for (;;) {\n" " nfds = epoll_wait(epollfd, events, MAX_EVENTS, -1);\n" " if (nfds == -1) {\n" " perror(\"epoll_wait\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (n = 0; n E nfds; ++n) {\n" " if (events[n].data.fd == listen_sock) {\n" " conn_sock = accept(listen_sock,\n" " (struct sockaddr *) &addr, &addrlen);\n" " if (conn_sock == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" " setnonblocking(conn_sock);\n" " ev.events = EPOLLIN | EPOLLET;\n" " ev.data.fd = conn_sock;\n" " if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock,\n" " &ev) == -1) {\n" " perror(\"epoll_ctl: conn_sock\");\n" " exit(EXIT_FAILURE);\n" " }\n" " } else {\n" " do_use_fd(events[n].data.fd);\n" " }\n" " }\n" "}\n" msgstr "" "#define MAX_EVENTS 10\n" "struct epoll_event ev, events[MAX_EVENTS];\n" "int listen_sock, conn_sock, nfds, epollfd;\n" "\\&\n" "/* Code to set up listening socket, \\[aq]listen_sock\\[aq],\n" " (socket(), bind(), listen()) omitted. */\n" "\\&\n" "epollfd = epoll_create1(0);\n" "if (epollfd == -1) {\n" " perror(\"epoll_create1\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "ev.events = EPOLLIN;\n" "ev.data.fd = listen_sock;\n" "if (epoll_ctl(epollfd, EPOLL_CTL_ADD, listen_sock, &ev) == -1) {\n" " perror(\"epoll_ctl: listen_sock\");\n" " exit(EXIT_FAILURE);\n" "}\n" "\\&\n" "for (;;) {\n" " nfds = epoll_wait(epollfd, events, MAX_EVENTS, -1);\n" " if (nfds == -1) {\n" " perror(\"epoll_wait\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " for (n = 0; n E nfds; ++n) {\n" " if (events[n].data.fd == listen_sock) {\n" " conn_sock = accept(listen_sock,\n" " (struct sockaddr *) &addr, &addrlen);\n" " if (conn_sock == -1) {\n" " perror(\"accept\");\n" " exit(EXIT_FAILURE);\n" " }\n" " setnonblocking(conn_sock);\n" " ev.events = EPOLLIN | EPOLLET;\n" " ev.data.fd = conn_sock;\n" " if (epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_sock,\n" " &ev) == -1) {\n" " perror(\"epoll_ctl: conn_sock\");\n" " exit(EXIT_FAILURE);\n" " }\n" " } else {\n" " do_use_fd(events[n].data.fd);\n" " }\n" " }\n" "}\n" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "2024-08-21" msgstr "21 أغسطس 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 "Linux man-pages 6.17" msgstr "صفحات دليل لينكس 6.17" #. type: TH #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Linux man-pages (unreleased)" msgstr "صفحات دليل لينكس (لم تصدر بعد)"