Debian Codegraph @

po/ar/man2/poll.2.po

raw
1 # Arabic translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # زايد السعيدي <[email protected]>, 2026.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.30.2\n"
8 "POT-Creation-Date: 2026-06-05 06:35+0200\n"
9 "PO-Revision-Date: 2026-05-18 18:06+0400\n"
10 "Last-Translator: Zayed Al-Saidi <[email protected]>\n"
11 "Language-Team: Arabic <[email protected]>\n"
12 "Language: ar\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
17 "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
18 "X-Generator: Lokalize 23.08.5\n"
19
20 #. type: TH
21 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
22 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
23 #, no-wrap
24 msgid "poll"
25 msgstr "poll"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2026-02-08"
32 msgstr "8 فبراير 2026"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "صفحات دليل لينكس 6.18"
39
40 #. type: SH
41 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
42 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "NAME"
45 msgstr "الاسم"
46
47 #. type: Plain text
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 msgid "poll, ppoll - wait for some event on a file descriptor"
51 msgstr "poll, ppoll - انتظار حدث ما على واصف ملف"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "LIBRARY"
58 msgstr "المكتبة"
59
60 #. type: Plain text
61 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
62 #: opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "Standard C library (I<libc>,\\ I<-lc>)"
64 msgstr "مكتبة سي المعيارية (I<libc>،\\ I<-lc>)"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "SYNOPSIS"
71 msgstr "موجز"
72
73 #. type: Plain text
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "B<#include E<lt>poll.hE<gt>>\n"
78 msgstr "B<#include E<lt>poll.hE<gt>>\n"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid "B<int poll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<, int >I<timeout>B<);>\n"
85 msgstr "B<int poll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<, int >I<timeout>B<);>\n"
86
87 #. type: Plain text
88 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
89 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
90 #, no-wrap
91 msgid ""
92 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
93 "B<#include E<lt>poll.hE<gt>>\n"
94 msgstr ""
95 "B<#define _GNU_SOURCE> /* انظر feature_test_macros(7) */\n"
96 "B<#include E<lt>poll.hE<gt>>\n"
97
98 #. type: Plain text
99 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
100 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
101 #, no-wrap
102 msgid ""
103 "B<int ppoll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<,>\n"
104 "B< const struct timespec *_Nullable >I<tmo_p>B<,>\n"
105 "B< const sigset_t *_Nullable >I<sigmask>B<);>\n"
106 msgstr ""
107 "B<int ppoll(struct pollfd *>I<fds>B<, nfds_t >I<nfds>B<,>\n"
108 "B< const struct timespec *_Nullable >I<tmo_p>B<,>\n"
109 "B< const sigset_t *_Nullable >I<sigmask>B<);>\n"
110
111 #. type: SH
112 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
113 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
114 #, no-wrap
115 msgid "DESCRIPTION"
116 msgstr "الوصف"
117
118 #. type: Plain text
119 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
120 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
121 msgid ""
122 "B<poll>() performs a similar task to B<select>(2): it waits for one of a "
123 "set of file descriptors to become ready to perform I/O. The Linux-specific "
124 "B<epoll>(7) API performs a similar task, but offers features beyond those "
125 "found in B<poll>()."
126 msgstr ""
127 "تقوم B<poll>() بمهمة مشابهة لـ B<select>(2): فهي تنتظر حتى يصبح أحد مجموعة "
128 "من واصفات الملفات جاهزًا لأداء الإدخال/الإخراج. تؤدي واجهة برمجة التطبيقات "
129 "الخاصة بلينكس B<epoll>(7) مهمة مشابهة، ولكنها تقدم ميزات تتجاوز تلك "
130 "الموجودة في B<poll>()."
131
132 #. type: Plain text
133 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
134 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
135 msgid ""
136 "The set of file descriptors to be monitored is specified in the I<fds> "
137 "argument, which is an array of structures of the following form:"
138 msgstr ""
139 "يتم تحديد مجموعة واصفات الملفات المراد مراقبتها في الوسيط I<fds>، وهو مصفوفة "
140 "من الهياكل بالشكل التالي:"
141
142 #. type: Plain text
143 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
144 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
145 #, no-wrap
146 msgid ""
147 "struct pollfd {\n"
148 " int fd; /* file descriptor */\n"
149 " short events; /* requested events */\n"
150 " short revents; /* returned events */\n"
151 "};\n"
152 msgstr ""
153 "struct pollfd {\n"
154 " int fd; /* واصف ملف */\n"
155 " short events; /* الأحداث المطلوبة */\n"
156 " short revents; /* الأحداث المعادة */\n"
157 "};\n"
158
159 #. type: Plain text
160 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
161 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
162 msgid ""
163 "The caller should specify the number of items in the I<fds> array in I<nfds>."
164 msgstr "يجب على المستدعي تحديد عدد العناصر في مصفوفة I<fds> في I<nfds>."
165
166 #. type: Plain text
167 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
168 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
169 msgid ""
170 "The field I<fd> contains a file descriptor for an open file. If this field "
171 "is negative, then the corresponding I<events> field is ignored and the "
172 "I<revents> field returns zero. (This provides an easy way of ignoring a "
173 "file descriptor for a single B<poll>() call: simply set the I<fd> field to "
174 "its bitwise complement.)"
175 msgstr ""
176 "يحتوي الحقل I<fd> على واصف ملف لملف مفتوح. إذا كان هذا الحقل سالبًا، فسيتم "
177 "تجاهل حقل I<events> المقابل ويعيد حقل I<revents> صفرًا. (يوفر هذا طريقة سهلة "
178 "لتجاهل واصف ملف لاستدعاء B<poll>() واحد: ببساطة اضبط حقل I<fd> على مكمله "
179 "بالبت.)"
180
181 #. type: Plain text
182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
184 msgid ""
185 "The field I<events> is an input parameter, a bit mask specifying the events "
186 "the application is interested in for the file descriptor I<fd>. This field "
187 "may be specified as zero, in which case the only events that can be returned "
188 "in I<revents> are B<POLLHUP>, B<POLLERR>, and B<POLLNVAL> (see below)."
189 msgstr ""
190 "الحقل I<events> هو معامل إدخال، قناع بت يحدد الأحداث التي يهتم بها التطبيق "
191 "لواصف الملف I<fd>. يمكن تحديد هذا الحقل كصفر، وفي هذه الحالة تكون الأحداث "
192 "الوحيدة التي يمكن إعادتها في I<revents> هي B<POLLHUP> و B<POLLERR> و "
193 "B<POLLNVAL> (انظر أدناه)."
194
195 #. type: Plain text
196 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
197 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
198 msgid ""
199 "The field I<revents> is an output parameter, filled by the kernel with the "
200 "events that actually occurred. The bits returned in I<revents> can include "
201 "any of those specified in I<events>, or one of the values B<POLLERR>, "
202 "B<POLLHUP>, or B<POLLNVAL>. (These three bits are meaningless in the "
203 "I<events> field, and will be set in the I<revents> field whenever the "
204 "corresponding condition is true.)"
205 msgstr ""
206 "الحقل I<revents> هو معامل إخراج، يملؤه النواة بالأحداث التي حدثت فعليًا. "
207 "يمكن أن تتضمن البتات المعادة في I<revents> أيًا من تلك المحددة في I<events>، "
208 "أو إحدى القيم B<POLLERR> أو B<POLLHUP> أو B<POLLNVAL>. (هذه البتات الثلاث "
209 "لا معنى لها في حقل I<events>، وسيتم تعيينها في حقل I<revents> كلما كان الشرط "
210 "المقابل صحيحًا.)"
211
212 #. type: Plain text
213 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
214 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
215 msgid ""
216 "If none of the events requested (and no error) has occurred for any of the "
217 "file descriptors, then B<poll>() blocks until one of the events occurs."
218 msgstr ""
219 "إذا لم يحدث أي من الأحداث المطلوبة (ولا خطأ) لأي من واصفات الملفات، فإن "
220 "B<poll>() تحظر حتى يقع أحد الأحداث."
221
222 #. type: Plain text
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 msgid ""
226 "The I<timeout> argument specifies the number of milliseconds that B<poll>() "
227 "should block waiting for a file descriptor to become ready. The call will "
228 "block until either:"
229 msgstr ""
230 "تحدد الوسيطة I<timeout> عدد الميلي ثانية التي يجب أن تحظر فيها B<poll>() في "
231 "انتظار أن يصبح واصف الملف جاهزًا. ستحظر الاستدعاء حتى:"
232
233 #. type: IP
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 #, no-wrap
237 msgid "\\[bu]"
238 msgstr "\\[bu]"
239
240 #. type: Plain text
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 msgid "a file descriptor becomes ready;"
244 msgstr "يصبح واصف الملف جاهزًا؛"
245
246 #. type: Plain text
247 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
248 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
249 msgid "the call is interrupted by a signal handler; or"
250 msgstr "الاستدعاء قوطع بواسطة معالج إشارة؛ أو"
251
252 #. type: Plain text
253 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
254 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
255 msgid "the timeout expires."
256 msgstr "انتهاء المهلة."
257
258 #. type: Plain text
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 msgid ""
262 "Being \"ready\" means that the requested operation will not block; thus, "
263 "B<poll>()ing regular files, block devices, and other files with no "
264 "reasonable polling semantic I<always> returns instantly as ready to read and "
265 "write."
266 msgstr ""
267 "كونه \"جاهزًا\" يعني أن العملية المطلوبة لن تحظر؛ وبالتالي، فإن استقصاء "
268 "B<poll>() للملفات العادية وأجهزة الكتل والملفات الأخرى التي لا تحتوي على "
269 "دلالات استقصاء معقولة يعود I<دائمًا> فورًا كجاهز للقراءة والكتابة."
270
271 #. type: Plain text
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 msgid ""
275 "Note that the I<timeout> interval will be rounded up to the system clock "
276 "granularity, and kernel scheduling delays mean that the blocking interval "
277 "may overrun by a small amount. Specifying a negative value in I<timeout> "
278 "means an infinite timeout. Specifying a I<timeout> of zero causes "
279 "B<poll>() to return immediately, even if no file descriptors are ready."
280 msgstr ""
281 "لاحظ أن الفاصل الزمني I<timeout> سيتم تقريبه لأعلى إلى دقة ساعة النظام، "
282 "وتأخيرات جدولة النواة تعني أن فترة الحظر قد تتجاوز بمقدار صغير. تحديد قيمة "
283 "سالبة في I<timeout> يعني مهلة غير محدودة. تحديد I<timeout> بقيمة صفر يتسبب "
284 "في عودة B<poll>() فورًا، حتى لو لم تكن أي واصفات ملفات جاهزة."
285
286 #. type: Plain text
287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
289 msgid ""
290 "The bits that may be set/returned in I<events> and I<revents> are defined in "
291 "I<E<lt>poll.hE<gt>>:"
292 msgstr ""
293 "البتات التي يمكن تعيينها/إعادتها في I<events> و I<revents> معرفة في "
294 "I<E<lt>poll.hE<gt>>:"
295
296 #. type: TP
297 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
298 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
299 #, no-wrap
300 msgid "B<POLLIN>"
301 msgstr "B<POLLIN>"
302
303 #. type: Plain text
304 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
305 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
306 msgid "There is data to read."
307 msgstr "توجد بيانات للقراءة."
308
309 #. type: TP
310 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
311 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
312 #, no-wrap
313 msgid "B<POLLPRI>"
314 msgstr "B<POLLPRI>"
315
316 #. type: Plain text
317 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
318 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
319 msgid ""
320 "There is some exceptional condition on the file descriptor. Possibilities "
321 "include:"
322 msgstr "توجد حالة استثنائية على واصف الملف. تشمل الاحتمالات:"
323
324 #. type: Plain text
325 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
326 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
327 msgid "There is out-of-band data on a TCP socket (see B<tcp>(7))."
328 msgstr "توجد بيانات خارج النطاق على مقبس TCP (انظر B<tcp>(7))."
329
330 #. type: Plain text
331 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
332 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
333 msgid ""
334 "A pseudoterminal master in packet mode has seen a state change on the slave "
335 "(see B<ioctl_tty>(2))."
336 msgstr ""
337 "رأى رئيس طرفي زائف في وضع الحزمة تغيير حالة على التابع (انظر "
338 "B<ioctl_tty>(2))."
339
340 #. type: Plain text
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 msgid "A I<cgroup.events> file has been modified (see B<cgroups>(7))."
344 msgstr "تم تعديل ملف I<cgroup.events> (انظر B<cgroups>(7))."
345
346 #. type: TP
347 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
348 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
349 #, no-wrap
350 msgid "B<POLLOUT>"
351 msgstr "B<POLLOUT>"
352
353 #. type: Plain text
354 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
355 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
356 msgid ""
357 "Writing is now possible, though a write larger than the available space in a "
358 "socket or pipe will still block (unless B<O_NONBLOCK> is set)."
359 msgstr ""
360 "الكتابة ممكنة الآن، على الرغم من أن كتابة أكبر من المساحة المتاحة في مقبس أو "
361 "أنبوب ستظل تحظر (ما لم يتم تعيين B<O_NONBLOCK>)."
362
363 #. type: TP
364 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
365 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
366 #, no-wrap
367 msgid "B<POLLRDHUP> (since Linux 2.6.17)"
368 msgstr "B<POLLRDHUP> (منذ لينكس 2.6.17)"
369
370 #. type: Plain text
371 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
372 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
373 msgid ""
374 "Stream socket peer closed connection, or shut down writing half of "
375 "connection. The B<_GNU_SOURCE> feature test macro must be defined (before "
376 "including I<any> header files) in order to obtain this definition."
377 msgstr ""
378 "أغلق نظير مقبس الدفق الاتصال، أو أوقف كتابة نصف الاتصال. يجب تعريف ماكرو "
379 "اختبار الميزة B<_GNU_SOURCE> (قبل تضمين I<أي> ملفات رأس) للحصول على هذا "
380 "التعريف."
381
382 #. type: TP
383 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
384 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
385 #, no-wrap
386 msgid "B<POLLERR>"
387 msgstr "B<POLLERR>"
388
389 #. type: Plain text
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 msgid ""
393 "Error condition (only returned in I<revents>; ignored in I<events>). This "
394 "bit is also set for a file descriptor referring to the write end of a pipe "
395 "when the read end has been closed."
396 msgstr ""
397 "حالة خطأ (تُعاد فقط في I<revents>؛ تُتجاهل في I<events>). يتم تعيين هذه البتة "
398 "أيضًا لواصف ملف يشير إلى نهاية الكتابة لأنبوب عندما يتم إغلاق نهاية القراءة."
399
400 #. type: TP
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 #, no-wrap
404 msgid "B<POLLHUP>"
405 msgstr "B<POLLHUP>"
406
407 #. type: Plain text
408 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
409 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
410 msgid ""
411 "Hang up (only returned in I<revents>; ignored in I<events>). Note that when "
412 "reading from a channel such as a pipe or a stream socket, this event merely "
413 "indicates that the peer closed its end of the channel. Subsequent reads "
414 "from the channel will return 0 (end of file) only after all outstanding "
415 "data in the channel has been consumed."
416 msgstr ""
417 "تعليق (يُعاد فقط في I<revents>؛ يُتجاهل في I<events>). لاحظ أنه عند القراءة "
418 "من قناة مثل أنبوب أو مقبس دفق، يشير هذا الحدث فقط إلى أن النظير أغلق نهايته "
419 "من القناة. ستعيد القراءات اللاحقة من القناة 0 (نهاية الملف) فقط بعد استهلاك "
420 "جميع البيانات المعلقة في القناة."
421
422 #. type: TP
423 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
424 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
425 #, no-wrap
426 msgid "B<POLLNVAL>"
427 msgstr "B<POLLNVAL>"
428
429 #. type: Plain text
430 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
431 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
432 msgid ""
433 "Invalid request: I<fd> not open (only returned in I<revents>; ignored in "
434 "I<events>)."
435 msgstr ""
436 "طلب غير صالح: I<fd> غير مفتوح (يُعاد فقط في I<revents>؛ يُتجاهل في I<events>)."
437
438 #. type: Plain text
439 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
440 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
441 msgid ""
442 "When compiling with B<_XOPEN_SOURCE> defined, one also has the following, "
443 "which convey no further information beyond the bits listed above:"
444 msgstr ""
445 "عند الترجمة مع تعريف B<_XOPEN_SOURCE>، تتوفر أيضًا القيم التالية، التي لا "
446 "تنقل معلومات إضافية تتجاوز البتات المذكورة أعلاه:"
447
448 #. type: TP
449 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
450 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
451 #, no-wrap
452 msgid "B<POLLRDNORM>"
453 msgstr "B<POLLRDNORM>"
454
455 #. type: Plain text
456 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
457 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
458 msgid "Equivalent to B<POLLIN>."
459 msgstr "مكافئ لـ B<POLLIN>."
460
461 #. type: TP
462 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
463 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
464 #, no-wrap
465 msgid "B<POLLRDBAND>"
466 msgstr "B<POLLRDBAND>"
467
468 #. POLLRDBAND is used in the DECnet protocol.
469 #. type: Plain text
470 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
471 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
472 msgid "Priority band data can be read (generally unused on Linux)."
473 msgstr "يمكن قراءة بيانات النطاق ذي الأولوية (غير مستخدمة عمومًا على لينكس)."
474
475 #. type: TP
476 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
477 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
478 #, no-wrap
479 msgid "B<POLLWRNORM>"
480 msgstr "B<POLLWRNORM>"
481
482 #. type: Plain text
483 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
484 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
485 msgid "Equivalent to B<POLLOUT>."
486 msgstr "مكافئ لـ B<POLLOUT>."
487
488 #. type: TP
489 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
490 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
491 #, no-wrap
492 msgid "B<POLLWRBAND>"
493 msgstr "B<POLLWRBAND>"
494
495 #. type: Plain text
496 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
497 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
498 msgid "Priority data may be written."
499 msgstr "يمكن كتابة بيانات ذات أولوية."
500
501 #. type: Plain text
502 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
503 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
504 msgid "Linux also knows about, but does not use B<POLLMSG>."
505 msgstr "لينكس يعرف أيضًا B<POLLMSG>، لكنه لا يستخدمه."
506
507 #. type: SS
508 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
509 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
510 #, no-wrap
511 msgid "ppoll()"
512 msgstr "ppoll()"
513
514 #. type: Plain text
515 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
516 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
517 msgid ""
518 "The relationship between B<poll>() and B<ppoll>() is analogous to the "
519 "relationship between B<select>(2) and B<pselect>(2): like B<pselect>(2), "
520 "B<ppoll>() allows an application to safely wait until either a file "
521 "descriptor becomes ready or until a signal is caught."
522 msgstr ""
523 "العلاقة بين B<poll>() وB<ppoll>() مماثلة للعلاقة بين B<select>(2) "
524 "وB<pselect>(2): مثل B<pselect>(2)، يسمح B<ppoll>() للتطبيق بالانتظار بأمان "
525 "حتى يصبح واصف ملف جاهزًا أو حتى يتم التقاط إشارة."
526
527 #. type: Plain text
528 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
529 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
530 msgid ""
531 "Other than the difference in the precision of the I<timeout> argument, the "
532 "following B<ppoll>() call:"
533 msgstr "بخلاف الاختلاف في دقة وسيط I<timeout>، فإن استدعاء B<ppoll>() التالي:"
534
535 #. type: Plain text
536 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
537 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
538 #, no-wrap
539 msgid "ready = ppoll(&fds, nfds, tmo_p, &sigmask);\n"
540 msgstr "ready = ppoll(&fds, nfds, tmo_p, &sigmask);\n"
541
542 #. type: Plain text
543 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
544 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
545 msgid "is nearly equivalent to I<atomically> executing the following calls:"
546 msgstr "يكاد يكون مكافئًا لتنفيذ الاستدعاءات التالية I<بشكل ذري>:"
547
548 #. type: Plain text
549 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
550 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
551 #, no-wrap
552 msgid ""
553 "sigset_t origmask;\n"
554 "int timeout;\n"
555 "\\&\n"
556 "timeout = (tmo_p == NULL) ? -1 :\n"
557 " (tmo_p-E<gt>tv_sec * 1000 + tmo_p-E<gt>tv_nsec / 1000000);\n"
558 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
559 "ready = poll(&fds, nfds, timeout);\n"
560 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
561 msgstr ""
562 "sigset_t origmask;\n"
563 "int timeout;\n"
564 "\\&\n"
565 "timeout = (tmo_p == NULL) ? -1 :\n"
566 " (tmo_p-E<gt>tv_sec * 1000 + tmo_p-E<gt>tv_nsec / 1000000);\n"
567 "pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
568 "ready = poll(&fds, nfds, timeout);\n"
569 "pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
570
571 #. type: Plain text
572 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
573 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
574 msgid ""
575 "The above code segment is described as I<nearly> equivalent because whereas "
576 "a negative I<timeout> value for B<poll>() is interpreted as an infinite "
577 "timeout, a negative value expressed in I<*tmo_p> results in an error from "
578 "B<ppoll>()."
579 msgstr ""
580 "يُوصف مقطع الكود أعلاه بأنه I<يكاد> يكون مكافئًا لأنه بينما تُفسر قيمة "
581 "I<timeout> السالبة لـ B<poll>() على أنها مهلة لا نهائية، تؤدي القيمة السالبة "
582 "المعبر عنها في I<*tmo_p> إلى خطأ من B<ppoll>()."
583
584 #. type: Plain text
585 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
586 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
587 msgid ""
588 "See the description of B<pselect>(2) for an explanation of why B<ppoll>() "
589 "is necessary."
590 msgstr "انظر وصف B<pselect>(2) لشرح سبب ضرورة B<ppoll>()."
591
592 #. type: Plain text
593 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
594 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
595 msgid ""
596 "If the I<sigmask> argument is specified as NULL, then no signal mask "
597 "manipulation is performed (and thus B<ppoll>() differs from B<poll>() only "
598 "in the precision of the I<timeout> argument)."
599 msgstr ""
600 "إذا تم تحديد وسيط I<sigmask> كـ NULL، فلا يتم إجراء أي معالجة لقناع الإشارة "
601 "(وبالتالي يختلف B<ppoll>() عن B<poll>() فقط في دقة وسيط I<timeout>)."
602
603 #. type: Plain text
604 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
605 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
606 msgid ""
607 "The I<tmo_p> argument specifies an upper limit on the amount of time that "
608 "B<ppoll>() will block. This argument is a pointer to a B<timespec>(3) "
609 "structure."
610 msgstr ""
611 "يحدد وسيط I<tmo_p> حدًا أعلى لمقدار الوقت الذي سينتظر فيه B<ppoll>() بشكل "
612 "محظور. هذا الوسيط هو مؤشر لبنية B<timespec>(3)."
613
614 #. type: Plain text
615 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
616 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
617 msgid ""
618 "If I<tmo_p> is specified as NULL, then B<ppoll>() can block indefinitely."
619 msgstr ""
620 "إذا تم تحديد I<tmo_p> كـ NULL، فيمكن لـ B<ppoll>() الانتظار بشكل محظور إلى "
621 "أجل غير مسمى."
622
623 #. type: SH
624 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
625 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
626 #, no-wrap
627 msgid "RETURN VALUE"
628 msgstr "قيمة الإرجاع"
629
630 #. type: Plain text
631 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
632 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
633 msgid ""
634 "On success, B<poll>() returns a nonnegative value which is the number of "
635 "elements in the I<pollfds> whose I<revents> fields have been set to a "
636 "nonzero value (indicating an event or an error). A return value of zero "
637 "indicates that the system call timed out before any file descriptors became "
638 "ready."
639 msgstr ""
640 "عند النجاح، تُرجع B<poll>() قيمة غير سالبة وهي عدد العناصر في I<pollfds> التي "
641 "تم تعيين حقول I<revents> فيها إلى قيمة غير صفرية (تشير إلى حدث أو خطأ). تشير "
642 "قيمة الإرجاع صفر إلى أن استدعاء النظام انتهت مهلة قبل أن يصبح أي واصف ملف "
643 "جاهزًا."
644
645 #. type: Plain text
646 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
647 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
648 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
649 msgstr "عند الخطأ، تُعاد القيمة -1، ويُضبط I<errno> للإشارة إلى الخطأ."
650
651 #. type: SH
652 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
653 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
654 #, no-wrap
655 msgid "ERRORS"
656 msgstr "الأخطاء"
657
658 #. type: TP
659 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
660 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
661 #, no-wrap
662 msgid "B<EFAULT>"
663 msgstr "B<EFAULT>"
664
665 #. type: Plain text
666 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
667 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
668 msgid ""
669 "I<fds> points outside the process's accessible address space. The array "
670 "given as argument was not contained in the calling program's address space."
671 msgstr ""
672 "يشير I<fds> إلى خارج مساحة العنوان القابلة للوصول للعملية. المصفوفة المعطاة "
673 "كوسيط لم تكن موجودة في مساحة عنوان البرنامج المستدعي."
674
675 #. type: TP
676 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
677 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
678 #, no-wrap
679 msgid "B<EINTR>"
680 msgstr "B<EINTR>"
681
682 #. type: Plain text
683 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
684 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
685 msgid "A signal occurred before any requested event; see B<signal>(7)."
686 msgstr "حدثت إشارة قبل أي حدث مطلوب؛ انظر B<signal>(7)."
687
688 #. type: TP
689 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
690 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
691 #, no-wrap
692 msgid "B<EINVAL>"
693 msgstr "B<EINVAL>"
694
695 #. type: Plain text
696 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
697 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
698 msgid "The I<nfds> value exceeds the B<RLIMIT_NOFILE> value."
699 msgstr "قيمة I<nfds> تتجاوز قيمة B<RLIMIT_NOFILE>."
700
701 #. type: Plain text
702 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
703 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
704 msgid ""
705 "(B<ppoll>()) The timeout value expressed in I<*tmo_p> is invalid (negative)."
706 msgstr "(B<ppoll>()) قيمة المهلة المعبر عنها في I<*tmo_p> غير صالحة (سالبة)."
707
708 #. type: TP
709 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
710 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
711 #, no-wrap
712 msgid "B<ENOMEM>"
713 msgstr "B<ENOMEM>"
714
715 #. type: Plain text
716 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
717 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
718 msgid "Unable to allocate memory for kernel data structures."
719 msgstr "غير قادر على تخصيص ذاكرة لهياكل بيانات النواة."
720
721 #. type: SH
722 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
723 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
724 #, no-wrap
725 msgid "VERSIONS"
726 msgstr "الإصدارات"
727
728 #. Darwin, according to a report by Jeremy Sequoia, relayed by Josh Triplett
729 #. type: Plain text
730 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
731 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
732 msgid ""
733 "On some other UNIX systems, B<poll>() can fail with the error B<EAGAIN> if "
734 "the system fails to allocate kernel-internal resources, rather than "
735 "B<ENOMEM> as Linux does. POSIX permits this behavior. Portable programs "
736 "may wish to check for B<EAGAIN> and loop, just as with B<EINTR>."
737 msgstr ""
738 "على بعض أنظمة UNIX الأخرى، يمكن أن يفشل B<poll>() مع الخطأ B<EAGAIN> إذا فشل "
739 "النظام في تخصيص موارد داخلية للنواة، بدلاً من B<ENOMEM> كما يفعل لينكس. يسمح "
740 "POSIX بهذا السلوك. قد ترغب البرامج المحمولة في التحقق من B<EAGAIN> والتكرار، "
741 "تمامًا كما هو الحال مع B<EINTR>."
742
743 #. type: Plain text
744 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
745 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
746 msgid ""
747 "Some implementations define the nonstandard constant B<INFTIM> with the "
748 "value -1 for use as a I<timeout> for B<poll>(). This constant is not "
749 "provided in glibc."
750 msgstr ""
751 "تعرف بعض التطبيقات الثابت غير القياسي B<INFTIM> بالقيمة -1 لاستخدامه كـ "
752 "I<timeout> لـ B<poll>(). هذا الثابت غير متوفر في glibc."
753
754 #. type: SS
755 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
756 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
757 #, no-wrap
758 msgid "C library/kernel differences"
759 msgstr "الاختلافات بين مكتبة C والنواة"
760
761 #. type: Plain text
762 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
763 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
764 msgid ""
765 "The Linux B<ppoll>() system call modifies its I<tmo_p> argument. However, "
766 "the glibc wrapper function hides this behavior by using a local variable for "
767 "the timeout argument that is passed to the system call. Thus, the glibc "
768 "B<ppoll>() function does not modify its I<tmo_p> argument."
769 msgstr ""
770 "استدعاء النظام B<ppoll>() في لينكس يُعدّل وسيطته I<tmo_p>. لكن دالة الغلاف "
771 "glibc تُخفي هذا السلوك باستخدام متغير محلي لوسيطة المهلة التي تُمرّر لاستدعاء "
772 "النظام. وبالتالي، دالة B<ppoll>() في glibc لا تُعدّل وسيطتها I<tmo_p>."
773
774 #. type: Plain text
775 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
776 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
777 msgid ""
778 "The raw B<ppoll>() system call has a fifth argument, I<size_t sigsetsize>, "
779 "which specifies the size in bytes of the I<sigmask> argument. The glibc "
780 "B<ppoll>() wrapper function specifies this argument as a fixed value (equal "
781 "to I<sizeof(kernel_sigset_t)>). See B<sigprocmask>(2) for a discussion on "
782 "the differences between the kernel and the libc notion of the sigset."
783 msgstr ""
784 "استدعاء النظام الخام B<ppoll>() يمتلك وسيطة خامسة، I<size_t sigsetsize>، "
785 "التي تُحدد الحجم بالبايت لوسيطة I<sigmask>. دالة الغلاف B<ppoll>() في glibc "
786 "تُحدد هذه الوسيطة بقيمة ثابتة (تساوي I<sizeof(kernel_sigset_t)>). انظر "
787 "B<sigprocmask>(2) لمناقشة الفروقات بين مفهوم النواة و libc لـ sigset."
788
789 #. type: SH
790 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
791 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
792 #, no-wrap
793 msgid "STANDARDS"
794 msgstr "المعايير"
795
796 #. type: Plain text
797 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
798 #: opensuse-tumbleweed
799 msgid "POSIX.1-2024."
800 msgstr "POSIX.1-2024."
801
802 #. type: SH
803 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
804 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
805 #, no-wrap
806 msgid "HISTORY"
807 msgstr "التاريخ"
808
809 #. type: TP
810 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
811 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
812 #, no-wrap
813 msgid "B<poll>()"
814 msgstr "B<poll>()"
815
816 #. type: Plain text
817 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
818 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
819 msgid "POSIX.1-2001. Linux 2.1.23."
820 msgstr "POSIX.1-2001. لينكس 2.1.23."
821
822 #. type: Plain text
823 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
824 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
825 msgid ""
826 "On older kernels that lack this system call, the glibc B<poll>() wrapper "
827 "function provides emulation using B<select>(2)."
828 msgstr ""
829 "على النوى القديمة التي تفتقر لاستدعاء النظام هذا، دالة الغلاف B<poll>() في "
830 "glibc تُوفّر محاكاة باستخدام B<select>(2)."
831
832 #. type: TP
833 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
834 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
835 #, no-wrap
836 msgid "B<ppoll>()"
837 msgstr "B<ppoll>()"
838
839 #. type: Plain text
840 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
841 #: opensuse-tumbleweed
842 msgid "POSIX.1-2024. Linux 2.6.16, glibc 2.4."
843 msgstr "POSIX.1-2024. لينكس 2.6.16، glibc 2.4."
844
845 #. type: SH
846 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
847 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
848 #, no-wrap
849 msgid "NOTES"
850 msgstr "ملاحظات"
851
852 #. type: Plain text
853 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
854 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
855 msgid ""
856 "The operation of B<poll>() and B<ppoll>() is not affected by the "
857 "B<O_NONBLOCK> flag."
858 msgstr "عملية B<poll>() و B<ppoll>() لا تتأثر بالعلامة B<O_NONBLOCK>."
859
860 #. type: Plain text
861 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
862 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
863 msgid ""
864 "For a discussion of what may happen if a file descriptor being monitored by "
865 "B<poll>() is closed in another thread, see B<select>(2)."
866 msgstr ""
867 "لمناقشة ما قد يحدث إذا أُغلق واصف ملف يُراقَب بواسطة B<poll>() في خيط آخر، "
868 "انظر B<select>(2)."
869
870 #. type: SH
871 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
872 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
873 #, no-wrap
874 msgid "BUGS"
875 msgstr "العلل"
876
877 #. type: Plain text
878 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
879 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
880 msgid ""
881 "See the discussion of spurious readiness notifications under the BUGS "
882 "section of B<select>(2)."
883 msgstr "انظر مناقشة إشعارات الجاهزية الزائفة تحت قسم BUGS في B<select>(2)."
884
885 #. type: SH
886 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
887 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
888 #, no-wrap
889 msgid "EXAMPLES"
890 msgstr "أمثلة"
891
892 #. type: Plain text
893 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
894 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
895 msgid ""
896 "The program below opens each of the files named in its command-line "
897 "arguments and monitors the resulting file descriptors for readiness to read "
898 "(B<POLLIN>). The program loops, repeatedly using B<poll>() to monitor the "
899 "file descriptors, printing the number of ready file descriptors on return. "
900 "For each ready file descriptor, the program:"
901 msgstr ""
902 "البرنامج أدناه يفتح كل ملف مُسمّى في وسائط سطر الأوامر ويُراقب واصفات الملف "
903 "الناتجة للجاهزية للقراءة (B<POLLIN>). البرنامج يُكرر، مستخدماً B<poll>() بشكل "
904 "متكرر لمراقبة واصفات الملف، طابعاً عدد واصفات الملف الجاهزة عند العودة. لكل "
905 "واصف ملف جاهز، البرنامج:"
906
907 #. type: Plain text
908 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
909 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
910 msgid "displays the returned I<revents> field in a human-readable form;"
911 msgstr "يعرض حقل I<revents> المُعاد بصيغة قابلة للقراءة البشرية؛"
912
913 #. type: Plain text
914 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
915 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
916 msgid ""
917 "if the file descriptor is readable, reads some data from it, and displays "
918 "that data on standard output; and"
919 msgstr ""
920 "إذا كان واصف الملف قابلاً للقراءة، يقرأ بعض البيانات منه، ويعرض تلك البيانات "
921 "على المخرجات القياسية؛ و"
922
923 #. type: Plain text
924 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
925 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
926 msgid ""
927 "if the file descriptor was not readable, but some other event occurred "
928 "(presumably B<POLLHUP>), closes the file descriptor."
929 msgstr ""
930 "إذا لم يكن واصف الملف قابلاً للقراءة، لكن حدث آخر وقع (يفترض B<POLLHUP>)، "
931 "يُغلق واصف الملف."
932
933 #. type: Plain text
934 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
935 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
936 msgid "Suppose we run the program in one terminal, asking it to open a FIFO:"
937 msgstr "لنفترض أننا نشغّل البرنامج في طرفية واحدة، نطلب منه فتح FIFO:"
938
939 #. type: Plain text
940 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
941 #: opensuse-tumbleweed
942 #, no-wrap
943 msgid ""
944 "$B< mkfifo myfifo>;\n"
945 "$B< ./poll_input myfifo>;\n"
946 msgstr ""
947 "$B< mkfifo myfifo>;\n"
948 "$B< ./poll_input myfifo>;\n"
949
950 #. type: Plain text
951 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
952 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
953 msgid ""
954 "In a second terminal window, we then open the FIFO for writing, write some "
955 "data to it, and close the FIFO:"
956 msgstr ""
957 "في نافذة طرفية ثانية، نفتح FIFO للكتابة، نكتب بعض البيانات إليه، ونُغلق FIFO:"
958
959 #. type: Plain text
960 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
961 #: opensuse-tumbleweed
962 #, no-wrap
963 msgid "$B< echo aaaaabbbbbccccc E<gt> myfifo>;\n"
964 msgstr "$B< echo aaaaabbbbbccccc E<gt> myfifo>;\n"
965
966 #. type: Plain text
967 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
968 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
969 msgid "In the terminal where we are running the program, we would then see:"
970 msgstr "في الطرفية حيث نشغّل البرنامج، سنرى بعدها:"
971
972 #. type: Plain text
973 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
974 #: opensuse-tumbleweed
975 #, no-wrap
976 msgid ""
977 "Opened \"myfifo\" on fd 3\n"
978 "About to poll()\n"
979 "Ready: 1\n"
980 " fd=3; events: POLLIN POLLHUP\n"
981 " read 10 bytes: aaaaabbbbb\n"
982 "About to poll()\n"
983 "Ready: 1\n"
984 " fd=3; events: POLLIN POLLHUP\n"
985 " read 6 bytes: ccccc\n"
986 "\\&\n"
987 "About to poll()\n"
988 "Ready: 1\n"
989 " fd=3; events: POLLHUP\n"
990 " closing fd 3\n"
991 "All file descriptors closed. Bye.\n"
992 msgstr ""
993 "Opened \"myfifo\" on fd 3\n"
994 "About to poll()\n"
995 "Ready: 1\n"
996 " fd=3; events: POLLIN POLLHUP\n"
997 " read 10 bytes: aaaaabbbbb\n"
998 "About to poll()\n"
999 "Ready: 1\n"
1000 " fd=3; events: POLLIN POLLHUP\n"
1001 " read 6 bytes: ccccc\n"
1002 "\\&\n"
1003 "About to poll()\n"
1004 "Ready: 1\n"
1005 " fd=3; events: POLLHUP\n"
1006 " closing fd 3\n"
1007 "All file descriptors closed. Bye.\n"
1008
1009 #. type: Plain text
1010 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1011 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1012 msgid "In the above output, we see that B<poll>() returned three times:"
1013 msgstr "في المخرجات أعلاه، نرى أن B<poll>() عاد ثلاث مرات:"
1014
1015 #. type: Plain text
1016 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1017 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1018 msgid ""
1019 "On the first return, the bits returned in the I<revents> field were "
1020 "B<POLLIN>, indicating that the file descriptor is readable, and B<POLLHUP>, "
1021 "indicating that the other end of the FIFO has been closed. The program then "
1022 "consumed some of the available input."
1023 msgstr ""
1024 "في العودة الأولى، البتات المُعادة في حقل I<revents> كانت B<POLLIN>، مشيرة إلى "
1025 "أن واصف الملف قابل للقراءة، و B<POLLHUP>، مشيرة إلى أن الطرف الآخر من FIFO "
1026 "أُغلق. البرنامج استهلك بعدها بعضاً من المُدخلات المتاحة."
1027
1028 #. type: Plain text
1029 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1030 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1031 msgid ""
1032 "The second return from B<poll>() also indicated B<POLLIN> and B<POLLHUP>; "
1033 "the program then consumed the last of the available input."
1034 msgstr ""
1035 "العودة الثانية من B<poll>() أشارت أيضًا إلى B<POLLIN> و B<POLLHUP>؛ البرنامج "
1036 "استهلك بعدها آخر المُدخلات المتاحة."
1037
1038 #. type: Plain text
1039 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1040 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1041 msgid ""
1042 "On the final return, B<poll>() indicated only B<POLLHUP> on the FIFO, at "
1043 "which point the file descriptor was closed and the program terminated."
1044 msgstr ""
1045 "في العودة النهائية، B<poll>() أشار فقط إلى B<POLLHUP> على FIFO، وعندها أُغلق "
1046 "واصف الملف وانتهى البرنامج."
1047
1048 #. type: SS
1049 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1050 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1051 #, no-wrap
1052 msgid "Program source"
1053 msgstr "مصدر البرنامج"
1054
1055 #. type: Plain text
1056 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1057 #: opensuse-tumbleweed
1058 #, no-wrap
1059 msgid ""
1060 "/* poll_input.c\n"
1061 "\\&\n"
1062 " Licensed under GNU General Public License v2 or later.\n"
1063 "*/\n"
1064 "#include E<lt>err.hE<gt>\n"
1065 "#include E<lt>fcntl.hE<gt>\n"
1066 "#include E<lt>poll.hE<gt>\n"
1067 "#include E<lt>stdio.hE<gt>\n"
1068 "#include E<lt>stdlib.hE<gt>\n"
1069 "#include E<lt>sys/types.hE<gt>\n"
1070 "#include E<lt>unistd.hE<gt>\n"
1071 "\\&\n"
1072 "int\n"
1073 "main(int argc, char *argv[])\n"
1074 "{\n"
1075 " int ready;\n"
1076 " char buf[10];\n"
1077 " nfds_t num_open_fds, nfds;\n"
1078 " ssize_t s;\n"
1079 " struct pollfd *pfds;\n"
1080 "\\&\n"
1081 " if (argc E<lt> 2) {\n"
1082 " fprintf(stderr, \"Usage: %s file...\\[rs]n\", argv[0]);\n"
1083 " exit(EXIT_FAILURE);\n"
1084 " }\n"
1085 "\\&\n"
1086 " num_open_fds = nfds = argc - 1;\n"
1087 " pfds = calloc(nfds, sizeof(struct pollfd));\n"
1088 " if (pfds == NULL)\n"
1089 " err(EXIT_FAILURE, \"malloc\");\n"
1090 "\\&\n"
1091 " /* Open each file on command line, and add it to \\[aq]pfds\\[aq] array. */\n"
1092 "\\&\n"
1093 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1094 " pfds[j].fd = open(argv[j + 1], O_RDONLY);\n"
1095 " if (pfds[j].fd == -1)\n"
1096 " err(EXIT_FAILURE, \"open\");\n"
1097 "\\&\n"
1098 " printf(\"Opened \\[rs]\"%s\\[rs]\" on fd %d\\[rs]n\", argv[j + 1], pfds[j].fd);\n"
1099 "\\&\n"
1100 " pfds[j].events = POLLIN;\n"
1101 " }\n"
1102 "\\&\n"
1103 " /* Keep calling poll() as long as at least one file descriptor is\n"
1104 " open. */\n"
1105 "\\&\n"
1106 " while (num_open_fds E<gt> 0) {\n"
1107 " printf(\"About to poll()\\[rs]n\");\n"
1108 " ready = poll(pfds, nfds, -1);\n"
1109 " if (ready == -1)\n"
1110 " err(EXIT_FAILURE, \"poll\");\n"
1111 "\\&\n"
1112 " printf(\"Ready: %d\\[rs]n\", ready);\n"
1113 "\\&\n"
1114 " /* Deal with array returned by poll(). */\n"
1115 "\\&\n"
1116 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1117 " if (pfds[j].revents != 0) {\n"
1118 " printf(\" fd=%d; events: %s%s%s\\[rs]n\", pfds[j].fd,\n"
1119 " (pfds[j].revents & POLLIN) ? \"POLLIN \" : \"\",\n"
1120 " (pfds[j].revents & POLLHUP) ? \"POLLHUP \" : \"\",\n"
1121 " (pfds[j].revents & POLLERR) ? \"POLLERR \" : \"\");\n"
1122 "\\&\n"
1123 " if (pfds[j].revents & POLLIN) {\n"
1124 " s = read(pfds[j].fd, buf, sizeof(buf));\n"
1125 " if (s == -1)\n"
1126 " err(EXIT_FAILURE, \"read\");\n"
1127 " printf(\" read %zd bytes: %.*s\\[rs]n\",\n"
1128 " s, (int) s, buf);\n"
1129 " } else { /* POLLERR | POLLHUP */\n"
1130 " printf(\" closing fd %d\\[rs]n\", pfds[j].fd);\n"
1131 " if (close(pfds[j].fd) == -1)\n"
1132 " err(EXIT_FAILURE, \"close\");\n"
1133 " num_open_fds--;\n"
1134 " }\n"
1135 " }\n"
1136 " }\n"
1137 " }\n"
1138 "\\&\n"
1139 " printf(\"All file descriptors closed. Bye.\\[rs]n\");\n"
1140 " exit(EXIT_SUCCESS);\n"
1141 "}\n"
1142 msgstr ""
1143 "/* poll_input.c\n"
1144 "\\&\n"
1145 " Licensed under GNU General Public License v2 or later.\n"
1146 "*/\n"
1147 "#include E<lt>err.hE<gt>\n"
1148 "#include E<lt>fcntl.hE<gt>\n"
1149 "#include E<lt>poll.hE<gt>\n"
1150 "#include E<lt>stdio.hE<gt>\n"
1151 "#include E<lt>stdlib.hE<gt>\n"
1152 "#include E<lt>sys/types.hE<gt>\n"
1153 "#include E<lt>unistd.hE<gt>\n"
1154 "\\&\n"
1155 "int\n"
1156 "main(int argc, char *argv[])\n"
1157 "{\n"
1158 " int ready;\n"
1159 " char buf[10];\n"
1160 " nfds_t num_open_fds, nfds;\n"
1161 " ssize_t s;\n"
1162 " struct pollfd *pfds;\n"
1163 "\\&\n"
1164 " if (argc E<lt> 2) {\n"
1165 " fprintf(stderr, \"Usage: %s file...\\[rs]n\", argv[0]);\n"
1166 " exit(EXIT_FAILURE);\n"
1167 " }\n"
1168 "\\&\n"
1169 " num_open_fds = nfds = argc - 1;\n"
1170 " pfds = calloc(nfds, sizeof(struct pollfd));\n"
1171 " if (pfds == NULL)\n"
1172 " err(EXIT_FAILURE, \"malloc\");\n"
1173 "\\&\n"
1174 " /* Open each file on command line, and add it to \\[aq]pfds\\[aq] array. */\n"
1175 "\\&\n"
1176 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1177 " pfds[j].fd = open(argv[j + 1], O_RDONLY);\n"
1178 " if (pfds[j].fd == -1)\n"
1179 " err(EXIT_FAILURE, \"open\");\n"
1180 "\\&\n"
1181 " printf(\"Opened \\[rs]\"%s\\[rs]\" on fd %d\\[rs]n\", argv[j + 1], pfds[j].fd);\n"
1182 "\\&\n"
1183 " pfds[j].events = POLLIN;\n"
1184 " }\n"
1185 "\\&\n"
1186 " /* Keep calling poll() as long as at least one file descriptor is\n"
1187 " open. */\n"
1188 "\\&\n"
1189 " while (num_open_fds E<gt> 0) {\n"
1190 " printf(\"About to poll()\\[rs]n\");\n"
1191 " ready = poll(pfds, nfds, -1);\n"
1192 " if (ready == -1)\n"
1193 " err(EXIT_FAILURE, \"poll\");\n"
1194 "\\&\n"
1195 " printf(\"Ready: %d\\[rs]n\", ready);\n"
1196 "\\&\n"
1197 " /* Deal with array returned by poll(). */\n"
1198 "\\&\n"
1199 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1200 " if (pfds[j].revents != 0) {\n"
1201 " printf(\" fd=%d; events: %s%s%s\\[rs]n\", pfds[j].fd,\n"
1202 " (pfds[j].revents & POLLIN) ? \"POLLIN \" : \"\",\n"
1203 " (pfds[j].revents & POLLHUP) ? \"POLLHUP \" : \"\",\n"
1204 " (pfds[j].revents & POLLERR) ? \"POLLERR \" : \"\");\n"
1205 "\\&\n"
1206 " if (pfds[j].revents & POLLIN) {\n"
1207 " s = read(pfds[j].fd, buf, sizeof(buf));\n"
1208 " if (s == -1)\n"
1209 " err(EXIT_FAILURE, \"read\");\n"
1210 " printf(\" read %zd bytes: %.*s\\[rs]n\",\n"
1211 " s, (int) s, buf);\n"
1212 " } else { /* POLLERR | POLLHUP */\n"
1213 " printf(\" closing fd %d\\[rs]n\", pfds[j].fd);\n"
1214 " if (close(pfds[j].fd) == -1)\n"
1215 " err(EXIT_FAILURE, \"close\");\n"
1216 " num_open_fds--;\n"
1217 " }\n"
1218 " }\n"
1219 " }\n"
1220 " }\n"
1221 "\\&\n"
1222 " printf(\"All file descriptors closed. Bye.\\[rs]n\");\n"
1223 " exit(EXIT_SUCCESS);\n"
1224 "}\n"
1225
1226 #. SRC END
1227 #. type: SH
1228 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1229 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1230 #, no-wrap
1231 msgid "SEE ALSO"
1232 msgstr "انظر أيضًا"
1233
1234 #. type: Plain text
1235 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1236 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1237 msgid ""
1238 "B<restart_syscall>(2), B<select>(2), B<select_tut>(2), B<timespec>(3), "
1239 "B<epoll>(7), B<time>(7)"
1240 msgstr ""
1241 "B<restart_syscall>(2), B<select>(2), B<select_tut>(2), B<timespec>(3), "
1242 "B<epoll>(7), B<time>(7)"
1243
1244 #. type: TH
1245 #: debian-trixie
1246 #, no-wrap
1247 msgid "2024-06-15"
1248 msgstr "15 يونيو 2024"
1249
1250 #. type: TH
1251 #: debian-trixie
1252 #, no-wrap
1253 msgid "Linux man-pages 6.9.1"
1254 msgstr "صفحات دليل لينكس 6.9.1"
1255
1256 #. type: Plain text
1257 #: debian-trixie
1258 msgid "Standard C library (I<libc>, I<-lc>)"
1259 msgstr "مكتبة سي المعيارية (I<libc>، I<-lc>)"
1260
1261 #. type: Plain text
1262 #: debian-trixie fedora-44 fedora-rawhide
1263 msgid "POSIX.1-2008."
1264 msgstr "POSIX.1-2008."
1265
1266 #. FIXME .
1267 #. ppoll() is proposed for inclusion in POSIX:
1268 #. https://www.austingroupbugs.net/view.php?id=1263
1269 #. NetBSD 3.0 has a pollts() which is like Linux ppoll().
1270 #. type: Plain text
1271 #: debian-trixie fedora-44 fedora-rawhide
1272 msgid "Linux."
1273 msgstr "لينكس."
1274
1275 #. type: Plain text
1276 #: debian-trixie fedora-44 fedora-rawhide
1277 msgid "Linux 2.6.16, glibc 2.4."
1278 msgstr "لينكس 2.6.16، glibc 2.4."
1279
1280 #. type: Plain text
1281 #: debian-trixie fedora-44 fedora-rawhide
1282 #, no-wrap
1283 msgid ""
1284 "$ B<mkfifo myfifo>\n"
1285 "$ B<./poll_input myfifo>\n"
1286 msgstr ""
1287 "$ B<mkfifo myfifo>\n"
1288 "$ B<./poll_input myfifo>\n"
1289
1290 #. type: Plain text
1291 #: debian-trixie fedora-44 fedora-rawhide
1292 #, no-wrap
1293 msgid "$ B<echo aaaaabbbbbccccc E<gt> myfifo>\n"
1294 msgstr "$ B<echo aaaaabbbbbccccc E<gt> myfifo>\n"
1295
1296 #. type: Plain text
1297 #: debian-trixie fedora-44 fedora-rawhide
1298 #, no-wrap
1299 msgid ""
1300 "Opened \"myfifo\" on fd 3\n"
1301 "About to poll()\n"
1302 "Ready: 1\n"
1303 " fd=3; events: POLLIN POLLHUP\n"
1304 " read 10 bytes: aaaaabbbbb\n"
1305 "About to poll()\n"
1306 "Ready: 1\n"
1307 " fd=3; events: POLLIN POLLHUP\n"
1308 " read 6 bytes: ccccc\n"
1309 "\\&\n"
1310 "About to poll()\n"
1311 "Ready: 1\n"
1312 " fd=3; events: POLLHUP\n"
1313 " closing fd 3\n"
1314 "All file descriptors closed; bye\n"
1315 msgstr ""
1316 "Opened \"myfifo\" on fd 3\n"
1317 "About to poll()\n"
1318 "Ready: 1\n"
1319 " fd=3; events: POLLIN POLLHUP\n"
1320 " read 10 bytes: aaaaabbbbb\n"
1321 "About to poll()\n"
1322 "Ready: 1\n"
1323 " fd=3; events: POLLIN POLLHUP\n"
1324 " read 6 bytes: ccccc\n"
1325 "\\&\n"
1326 "About to poll()\n"
1327 "Ready: 1\n"
1328 " fd=3; events: POLLHUP\n"
1329 " closing fd 3\n"
1330 "All file descriptors closed; bye\n"
1331
1332 #. type: Plain text
1333 #: debian-trixie fedora-44 fedora-rawhide
1334 #, no-wrap
1335 msgid ""
1336 "/* poll_input.c\n"
1337 "\\&\n"
1338 " Licensed under GNU General Public License v2 or later.\n"
1339 "*/\n"
1340 "#include E<lt>fcntl.hE<gt>\n"
1341 "#include E<lt>poll.hE<gt>\n"
1342 "#include E<lt>stdio.hE<gt>\n"
1343 "#include E<lt>stdlib.hE<gt>\n"
1344 "#include E<lt>sys/types.hE<gt>\n"
1345 "#include E<lt>unistd.hE<gt>\n"
1346 "\\&\n"
1347 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1348 " } while (0)\n"
1349 "\\&\n"
1350 "int\n"
1351 "main(int argc, char *argv[])\n"
1352 "{\n"
1353 " int ready;\n"
1354 " char buf[10];\n"
1355 " nfds_t num_open_fds, nfds;\n"
1356 " ssize_t s;\n"
1357 " struct pollfd *pfds;\n"
1358 "\\&\n"
1359 " if (argc E<lt> 2) {\n"
1360 " fprintf(stderr, \"Usage: %s file...\\[rs]n\", argv[0]);\n"
1361 " exit(EXIT_FAILURE);\n"
1362 " }\n"
1363 "\\&\n"
1364 " num_open_fds = nfds = argc - 1;\n"
1365 " pfds = calloc(nfds, sizeof(struct pollfd));\n"
1366 " if (pfds == NULL)\n"
1367 " errExit(\"malloc\");\n"
1368 "\\&\n"
1369 " /* Open each file on command line, and add it to \\[aq]pfds\\[aq] array. */\n"
1370 "\\&\n"
1371 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1372 " pfds[j].fd = open(argv[j + 1], O_RDONLY);\n"
1373 " if (pfds[j].fd == -1)\n"
1374 " errExit(\"open\");\n"
1375 "\\&\n"
1376 " printf(\"Opened \\[rs]\"%s\\[rs]\" on fd %d\\[rs]n\", argv[j + 1], pfds[j].fd);\n"
1377 "\\&\n"
1378 " pfds[j].events = POLLIN;\n"
1379 " }\n"
1380 "\\&\n"
1381 " /* Keep calling poll() as long as at least one file descriptor is\n"
1382 " open. */\n"
1383 "\\&\n"
1384 " while (num_open_fds E<gt> 0) {\n"
1385 " printf(\"About to poll()\\[rs]n\");\n"
1386 " ready = poll(pfds, nfds, -1);\n"
1387 " if (ready == -1)\n"
1388 " errExit(\"poll\");\n"
1389 "\\&\n"
1390 " printf(\"Ready: %d\\[rs]n\", ready);\n"
1391 "\\&\n"
1392 " /* Deal with array returned by poll(). */\n"
1393 "\\&\n"
1394 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1395 " if (pfds[j].revents != 0) {\n"
1396 " printf(\" fd=%d; events: %s%s%s\\[rs]n\", pfds[j].fd,\n"
1397 " (pfds[j].revents & POLLIN) ? \"POLLIN \" : \"\",\n"
1398 " (pfds[j].revents & POLLHUP) ? \"POLLHUP \" : \"\",\n"
1399 " (pfds[j].revents & POLLERR) ? \"POLLERR \" : \"\");\n"
1400 "\\&\n"
1401 " if (pfds[j].revents & POLLIN) {\n"
1402 " s = read(pfds[j].fd, buf, sizeof(buf));\n"
1403 " if (s == -1)\n"
1404 " errExit(\"read\");\n"
1405 " printf(\" read %zd bytes: %.*s\\[rs]n\",\n"
1406 " s, (int) s, buf);\n"
1407 " } else { /* POLLERR | POLLHUP */\n"
1408 " printf(\" closing fd %d\\[rs]n\", pfds[j].fd);\n"
1409 " if (close(pfds[j].fd) == -1)\n"
1410 " errExit(\"close\");\n"
1411 " num_open_fds--;\n"
1412 " }\n"
1413 " }\n"
1414 " }\n"
1415 " }\n"
1416 "\\&\n"
1417 " printf(\"All file descriptors closed; bye\\[rs]n\");\n"
1418 " exit(EXIT_SUCCESS);\n"
1419 "}\n"
1420 msgstr ""
1421 "/* poll_input.c\n"
1422 "\\&\n"
1423 " Licensed under GNU General Public License v2 or later.\n"
1424 "*/\n"
1425 "#include E<lt>fcntl.hE<gt>\n"
1426 "#include E<lt>poll.hE<gt>\n"
1427 "#include E<lt>stdio.hE<gt>\n"
1428 "#include E<lt>stdlib.hE<gt>\n"
1429 "#include E<lt>sys/types.hE<gt>\n"
1430 "#include E<lt>unistd.hE<gt>\n"
1431 "\\&\n"
1432 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\[rs]\n"
1433 " } while (0)\n"
1434 "\\&\n"
1435 "int\n"
1436 "main(int argc, char *argv[])\n"
1437 "{\n"
1438 " int ready;\n"
1439 " char buf[10];\n"
1440 " nfds_t num_open_fds, nfds;\n"
1441 " ssize_t s;\n"
1442 " struct pollfd *pfds;\n"
1443 "\\&\n"
1444 " if (argc E<lt> 2) {\n"
1445 " fprintf(stderr, \"Usage: %s file...\\[rs]n\", argv[0]);\n"
1446 " exit(EXIT_FAILURE);\n"
1447 " }\n"
1448 "\\&\n"
1449 " num_open_fds = nfds = argc - 1;\n"
1450 " pfds = calloc(nfds, sizeof(struct pollfd));\n"
1451 " if (pfds == NULL)\n"
1452 " errExit(\"malloc\");\n"
1453 "\\&\n"
1454 " /* Open each file on command line, and add it to \\[aq]pfds\\[aq] array. */\n"
1455 "\\&\n"
1456 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1457 " pfds[j].fd = open(argv[j + 1], O_RDONLY);\n"
1458 " if (pfds[j].fd == -1)\n"
1459 " errExit(\"open\");\n"
1460 "\\&\n"
1461 " printf(\"Opened \\[rs]\"%s\\[rs]\" on fd %d\\[rs]n\", argv[j + 1], pfds[j].fd);\n"
1462 "\\&\n"
1463 " pfds[j].events = POLLIN;\n"
1464 " }\n"
1465 "\\&\n"
1466 " /* Keep calling poll() as long as at least one file descriptor is\n"
1467 " open. */\n"
1468 "\\&\n"
1469 " while (num_open_fds E<gt> 0) {\n"
1470 " printf(\"About to poll()\\[rs]n\");\n"
1471 " ready = poll(pfds, nfds, -1);\n"
1472 " if (ready == -1)\n"
1473 " errExit(\"poll\");\n"
1474 "\\&\n"
1475 " printf(\"Ready: %d\\[rs]n\", ready);\n"
1476 "\\&\n"
1477 " /* Deal with array returned by poll(). */\n"
1478 "\\&\n"
1479 " for (nfds_t j = 0; j E<lt> nfds; j++) {\n"
1480 " if (pfds[j].revents != 0) {\n"
1481 " printf(\" fd=%d; events: %s%s%s\\[rs]n\", pfds[j].fd,\n"
1482 " (pfds[j].revents & POLLIN) ? \"POLLIN \" : \"\",\n"
1483 " (pfds[j].revents & POLLHUP) ? \"POLLHUP \" : \"\",\n"
1484 " (pfds[j].revents & POLLERR) ? \"POLLERR \" : \"\");\n"
1485 "\\&\n"
1486 " if (pfds[j].revents & POLLIN) {\n"
1487 " s = read(pfds[j].fd, buf, sizeof(buf));\n"
1488 " if (s == -1)\n"
1489 " errExit(\"read\");\n"
1490 " printf(\" read %zd bytes: %.*s\\[rs]n\",\n"
1491 " s, (int) s, buf);\n"
1492 " } else { /* POLLERR | POLLHUP */\n"
1493 " printf(\" closing fd %d\\[rs]n\", pfds[j].fd);\n"
1494 " if (close(pfds[j].fd) == -1)\n"
1495 " errExit(\"close\");\n"
1496 " num_open_fds--;\n"
1497 " }\n"
1498 " }\n"
1499 " }\n"
1500 " }\n"
1501 "\\&\n"
1502 " printf(\"All file descriptors closed; bye\\[rs]n\");\n"
1503 " exit(EXIT_SUCCESS);\n"
1504 "}\n"
1505
1506 #. type: TH
1507 #: fedora-44 fedora-rawhide
1508 #, no-wrap
1509 msgid "2024-07-23"
1510 msgstr "23 يوليو 2024"
1511
1512 #. type: TH
1513 #: fedora-44 fedora-rawhide
1514 #, no-wrap
1515 msgid "Linux man-pages 6.13"
1516 msgstr "صفحات دليل لينكس 6.13"
1517
1518 #. type: TH
1519 #: mageia-cauldron
1520 #, no-wrap
1521 msgid "Linux man-pages 6.17"
1522 msgstr "صفحات دليل لينكس 6.17"
1523
1524 #. type: TH
1525 #: opensuse-leap-16-1 opensuse-tumbleweed
1526 #, no-wrap
1527 msgid "Linux man-pages (unreleased)"
1528 msgstr "صفحات دليل لينكس (لم تصدر بعد)"