Debian Codegraph @

po/ar/man3/getservent_r.3.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:26+0200\n"
9 "PO-Revision-Date: 2026-06-01 18:22+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 "getservent_r"
25 msgstr "getservent_r"
26
27 #. type: TH
28 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-22"
31 msgstr "22 فبراير 2026"
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr "صفحات دليل لينكس 6.18"
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr "الاسم"
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid ""
50 "getservent_r, getservbyname_r, getservbyport_r - get service entry "
51 "(reentrant)"
52 msgstr ""
53 "getservent_r, getservbyname_r, getservbyport_r - الحصول على مدخل الخدمة "
54 "(قابل لإعادة الدخول)"
55
56 #. type: SH
57 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
58 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
59 #, no-wrap
60 msgid "LIBRARY"
61 msgstr "المكتبة"
62
63 #. type: Plain text
64 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
65 #: opensuse-leap-16-1 opensuse-tumbleweed
66 msgid "Standard C library (I<libc>,\\ I<-lc>)"
67 msgstr "مكتبة سي المعيارية (I<libc>،\\ I<-lc>)"
68
69 #. type: SH
70 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
71 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
72 #, no-wrap
73 msgid "SYNOPSIS"
74 msgstr "موجز"
75
76 #. type: Plain text
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid "B<#include E<lt>netdb.hE<gt>>\n"
81 msgstr "B<#include E<lt>netdb.hE<gt>>\n"
82
83 #. type: Plain text
84 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
85 #: opensuse-tumbleweed
86 #, no-wrap
87 msgid ""
88 "B<int getservent_r(>size_t size;\n"
89 "B< struct servent *restrict >I<result_buf>B<,>\n"
90 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
91 "B< struct servent **restrict >I<result>B<);>\n"
92 "B<int getservbyname_r(>size_t size;\n"
93 "B< const char *restrict >I<name>B<,>\n"
94 "B< const char *restrict >I<proto>B<,>\n"
95 "B< struct servent *restrict >I<result_buf>B<,>\n"
96 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
97 "B< struct servent **restrict >I<result>B<);>\n"
98 "B<int getservbyport_r(>size_t size;\n"
99 "B< int >I<port>B<,>\n"
100 "B< const char *restrict >I<proto>B<,>\n"
101 "B< struct servent *restrict >I<result_buf>B<,>\n"
102 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
103 "B< struct servent **restrict >I<result>B<);>\n"
104 msgstr ""
105 "B<int getservent_r(>size_t size;\n"
106 "B< struct servent *restrict >I<result_buf>B<,>\n"
107 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
108 "B< struct servent **restrict >I<result>B<);>\n"
109 "B<int getservbyname_r(>size_t size;\n"
110 "B< const char *restrict >I<name>B<,>\n"
111 "B< const char *restrict >I<proto>B<,>\n"
112 "B< struct servent *restrict >I<result_buf>B<,>\n"
113 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
114 "B< struct servent **restrict >I<result>B<);>\n"
115 "B<int getservbyport_r(>size_t size;\n"
116 "B< int >I<port>B<,>\n"
117 "B< const char *restrict >I<proto>B<,>\n"
118 "B< struct servent *restrict >I<result_buf>B<,>\n"
119 "B< char >I<buf>B<[restrict >I<size>B<], size_t >I<size>B<,>\n"
120 "B< struct servent **restrict >I<result>B<);>\n"
121
122 #. type: Plain text
123 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
124 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
125 msgid ""
126 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
127 msgstr ""
128 "متطلبات ماكروات اختبار الميزات لـ glibc (انظر B<feature_test_macros>(7)):"
129
130 #. type: Plain text
131 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
132 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
133 msgid "B<getservent_r>(), B<getservbyname_r>(), B<getservbyport_r>():"
134 msgstr "B<getservent_r>(), B<getservbyname_r>(), B<getservbyport_r>():"
135
136 #. type: Plain text
137 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
138 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
139 #, no-wrap
140 msgid ""
141 " Since glibc 2.19:\n"
142 " _DEFAULT_SOURCE\n"
143 " glibc 2.19 and earlier:\n"
144 " _BSD_SOURCE || _SVID_SOURCE\n"
145 msgstr ""
146 " منذ glibc 2.19:\n"
147 " _DEFAULT_SOURCE\n"
148 " glibc 2.19 وما قبله:\n"
149 " _BSD_SOURCE || _SVID_SOURCE\n"
150
151 #. type: SH
152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
154 #, no-wrap
155 msgid "DESCRIPTION"
156 msgstr "الوصف"
157
158 #. type: Plain text
159 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
160 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
161 msgid ""
162 "The B<getservent_r>(), B<getservbyname_r>(), and B<getservbyport_r>() "
163 "functions are the reentrant equivalents of, respectively, B<getservent>(3), "
164 "B<getservbyname>(3), and B<getservbyport>(3). They differ in the way that "
165 "the I<servent> structure is returned, and in the function calling signature "
166 "and return value. This manual page describes just the differences from the "
167 "nonreentrant functions."
168 msgstr ""
169 "الدوال B<getservent_r>() و B<getservbyname_r>() و B<getservbyport_r>() هي "
170 "المعادلات القابلة لإعادة الدخول لـ B<getservent>(3) و B<getservbyname>(3) و "
171 "B<getservbyport>(3) على التوالي. تختلف في طريقة إعادة بنية I<servent>، وفي "
172 "توقيع استدعاء الدالة وقيمة الإرجاع. تصف صفحة الدليل هذه الاختلافات فقط عن "
173 "الدوال غير القابلة لإعادة الدخول."
174
175 #. type: Plain text
176 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
177 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
178 msgid ""
179 "Instead of returning a pointer to a statically allocated I<servent> "
180 "structure as the function result, these functions copy the structure into "
181 "the location pointed to by I<result_buf>."
182 msgstr ""
183 "بدلاً من إرجاع مؤشر إلى بنية I<servent> مخصصة بشكل ثابت كنتيجة للدالة، تنسخ "
184 "هذه الدوال البنية إلى الموقع المشار إليه بواسطة I<result_buf>."
185
186 #. I can find no information on the required/recommended buffer size;
187 #. the nonreentrant functions use a 1024 byte buffer -- mtk.
188 #. type: Plain text
189 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
190 #: opensuse-leap-16-1 opensuse-tumbleweed
191 msgid ""
192 "The I<buf> array is used to store the string fields pointed to by the "
193 "returned I<servent> structure. (The nonreentrant functions allocate these "
194 "strings in static storage.) The size of this array is specified in "
195 "I<size>. If I<buf> is too small, the call fails with the error B<ERANGE>, "
196 "and the caller must try again with a larger buffer. (A buffer of size 1024 "
197 "bytes should be sufficient for most applications.)"
198 msgstr ""
199 "تُستخدم مصفوفة I<buf> لتخزين حقول السلاسل المحارف المشار إليها بواسطة بنية "
200 "I<servent> المعادة. (تخصص الدوال غير القابلة لإعادة الدخول هذه السلاسل في "
201 "تخزين ثابت.) يُحدد حجم هذه المصفوفة في I<size>. إذا كانت I<buf> صغيرة جدًا، "
202 "يفشل الاستدعاء مع الخطأ B<ERANGE>، ويجب على المستدعي المحاولة مرة أخرى بمخزن "
203 "مؤقت أكبر. (يجب أن يكون مخزن مؤقت بحجم 1024 بايت كافيًا لمعظم التطبيقات.)"
204
205 #. type: Plain text
206 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
207 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
208 msgid ""
209 "If the function call successfully obtains a service record, then I<*result> "
210 "is set pointing to I<result_buf>; otherwise, I<*result> is set to NULL."
211 msgstr ""
212 "إذا حصل استدعاء الدالة بنجاح على سجل خدمة، فسيُضبط I<*result> للإشارة إلى "
213 "I<result_buf>؛ وإلا، فسيُضبط I<*result> إلى NULL."
214
215 #. type: SH
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 #, no-wrap
219 msgid "RETURN VALUE"
220 msgstr "قيمة الإرجاع"
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 "On success, these functions return 0. On error, they return one of the "
227 "positive error numbers listed in errors."
228 msgstr ""
229 "عند النجاح، تُرجع هذه الدوال 0. عند الخطأ، تُرجع أحد أرقام الأخطاء الموجبة "
230 "المدرجة في الأخطاء."
231
232 #. type: Plain text
233 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
234 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
235 msgid ""
236 "On error, record not found (B<getservbyname_r>(), B<getservbyport_r>()), or "
237 "end of input (B<getservent_r>()) I<result> is set to NULL."
238 msgstr ""
239 "عند الخطأ، السجل غير موجود (B<getservbyname_r>()، B<getservbyport_r>())، أو "
240 "نهاية الإدخال (B<getservent_r>()) يُضبط I<result> إلى NULL."
241
242 #. type: SH
243 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
244 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
245 #, no-wrap
246 msgid "ERRORS"
247 msgstr "الأخطاء"
248
249 #. type: TP
250 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
251 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
252 #, no-wrap
253 msgid "B<ENOENT>"
254 msgstr "B<ENOENT>"
255
256 #. type: Plain text
257 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
258 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
259 msgid "(B<getservent_r>()) No more records in database."
260 msgstr "(B<getservent_r>()) لا مزيد من السجلات في قاعدة البيانات."
261
262 #. type: TP
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 #, no-wrap
266 msgid "B<ERANGE>"
267 msgstr "B<ERANGE>"
268
269 #. type: Plain text
270 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
271 #: opensuse-leap-16-1 opensuse-tumbleweed
272 msgid ""
273 "I<buf> is too small. Try again with a larger buffer (and increased I<size>)."
274 msgstr ""
275 "المخزن المؤقت I<buf> صغير جدًا. حاول مرة أخرى بمخزن أكبر (وزيادة I<size>)."
276
277 #. type: SH
278 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
279 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
280 #, no-wrap
281 msgid "ATTRIBUTES"
282 msgstr "السمات"
283
284 #. type: Plain text
285 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
286 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
287 msgid ""
288 "For an explanation of the terms used in this section, see B<attributes>(7)."
289 msgstr ""
290 "للاطلاع على شرح للمصطلحات المستخدمة في هذا القسم، انظر B<attributes>(7)."
291
292 #. type: tbl table
293 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
294 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
295 #, no-wrap
296 msgid "Interface"
297 msgstr "الواجهة"
298
299 #. type: tbl table
300 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
301 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
302 #, no-wrap
303 msgid "Attribute"
304 msgstr "السمة"
305
306 #. type: tbl table
307 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
308 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
309 #, no-wrap
310 msgid "Value"
311 msgstr "القيمة"
312
313 #. type: tbl table
314 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
315 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
316 #, no-wrap
317 msgid ".na\n"
318 msgstr ".na\n"
319
320 #. type: tbl table
321 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
322 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
323 #, no-wrap
324 msgid ".nh\n"
325 msgstr ".nh\n"
326
327 #. type: tbl table
328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
330 #, no-wrap
331 msgid ""
332 "B<getservent_r>(),\n"
333 "B<getservbyname_r>(),\n"
334 "B<getservbyport_r>()"
335 msgstr ""
336 "B<getservent_r>(),\n"
337 "B<getservbyname_r>(),\n"
338 "B<getservbyport_r>()"
339
340 #. type: tbl table
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 #, no-wrap
344 msgid "Thread safety"
345 msgstr "سلامة الخيوط"
346
347 #. type: tbl table
348 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
349 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
350 #, no-wrap
351 msgid "MT-Safe locale"
352 msgstr "المنطقة (locale) آمنة لتعدد المسالك (MT-Safe)"
353
354 #. type: SH
355 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
356 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
357 #, no-wrap
358 msgid "VERSIONS"
359 msgstr "الإصدارات"
360
361 #. type: Plain text
362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
364 msgid ""
365 "Functions with similar names exist on some other systems, though typically "
366 "with different calling signatures."
367 msgstr ""
368 "توجد دوال بأسماء مماثلة في بعض الأنظمة الأخرى، وإن كان ذلك عادةً بتواقيع "
369 "استدعاء مختلفة."
370
371 #. type: SH
372 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
373 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
374 #, no-wrap
375 msgid "STANDARDS"
376 msgstr "المعايير"
377
378 #. type: Plain text
379 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
380 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
381 msgid "GNU."
382 msgstr "GNU."
383
384 #. type: SH
385 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
386 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
387 #, no-wrap
388 msgid "EXAMPLES"
389 msgstr "أمثلة"
390
391 #. type: Plain text
392 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
393 #: opensuse-leap-16-1 opensuse-tumbleweed
394 msgid ""
395 "The program below uses B<getservbyport_r>() to retrieve the service record "
396 "for the port and protocol named in its first command-line argument. If a "
397 "third (integer) command-line argument is supplied, it is used as the initial "
398 "value for I<size>; if B<getservbyport_r>() fails with the error B<ERANGE>, "
399 "the program retries with larger buffer sizes. The following shell session "
400 "shows a couple of sample runs:"
401 msgstr ""
402 "يستخدم البرنامج أدناه B<getservbyport_r>() لاسترداد سجل الخدمة للمنفذ "
403 "والبروتوكول المذكورين في وسيطة سطر الأوامر الأولى. إذا تم توفير وسيطة سطر "
404 "أوامر ثالثة (عدد صحيح)، فتُستخدم كقيمة مبدئية لـ I<size>؛ إذا فشل "
405 "B<getservbyport_r>() مع الخطأ B<ERANGE>، يعيد البرنامج المحاولة بأحجام مخزن "
406 "مؤقت أكبر. تُظهر جلسة الصدفة التالية بعض الأمثلة على التشغيل:"
407
408 #. type: Plain text
409 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
410 #: opensuse-leap-16-1 opensuse-tumbleweed
411 #, no-wrap
412 msgid ""
413 "$B< ./a.out 7 tcp 1>\n"
414 "ERANGE! Retrying with larger buffer\n"
415 "getservbyport_r() returned: 0 (success) (size=87)\n"
416 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
417 "$B< ./a.out 77777 tcp>\n"
418 "getservbyport_r() returned: 0 (success) (size=1024)\n"
419 "Call failed/record not found\n"
420 msgstr ""
421 "$B< ./a.out 7 tcp 1>\n"
422 "ERANGE! Retrying with larger buffer\n"
423 "getservbyport_r() returned: 0 (success) (size=87)\n"
424 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
425 "$B< ./a.out 77777 tcp>\n"
426 "getservbyport_r() returned: 0 (success) (size=1024)\n"
427 "Call failed/record not found\n"
428
429 #. type: SS
430 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
431 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
432 #, no-wrap
433 msgid "Program source"
434 msgstr "مصدر البرنامج"
435
436 #. type: Plain text
437 #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed
438 #, no-wrap
439 msgid ""
440 "#define _GNU_SOURCE\n"
441 "#include E<lt>ctype.hE<gt>\n"
442 "#include E<lt>errno.hE<gt>\n"
443 "#include E<lt>netdb.hE<gt>\n"
444 "#include E<lt>stdio.hE<gt>\n"
445 "#include E<lt>stdlib.hE<gt>\n"
446 "#include E<lt>string.hE<gt>\n"
447 "\\&\n"
448 "#define MAX_BUF 10000\n"
449 "\\&\n"
450 "#define streq(...) (strcmp(__VA_ARGS__) == 0)\n"
451 "\\&\n"
452 "int\n"
453 "main(int argc, char *argv[])\n"
454 "{\n"
455 " int size, erange_cnt, port, s;\n"
456 " struct servent result_buf;\n"
457 " struct servent *result;\n"
458 " char buf[MAX_BUF];\n"
459 " char *protop;\n"
460 "\\&\n"
461 " if (argc E<lt> 3) {\n"
462 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
463 " exit(EXIT_FAILURE);\n"
464 " }\n"
465 "\\&\n"
466 " port = htons(atoi(argv[1]));\n"
467 " protop = (streq(argv[2], \"null\") ||\n"
468 " streq(argv[2], \"NULL\")) ? NULL : argv[2];\n"
469 "\\&\n"
470 " size = 1024;\n"
471 " if (argc E<gt> 3)\n"
472 " size = atoi(argv[3]);\n"
473 "\\&\n"
474 " if (size E<gt> MAX_BUF) {\n"
475 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
476 " exit(EXIT_FAILURE);\n"
477 " }\n"
478 "\\&\n"
479 " erange_cnt = 0;\n"
480 " do {\n"
481 " s = getservbyport_r(port, protop, &result_buf,\n"
482 " buf, size, &result);\n"
483 " if (s == ERANGE) {\n"
484 " if (erange_cnt == 0)\n"
485 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
486 " erange_cnt++;\n"
487 "\\&\n"
488 " /* Increment a byte at a time so we can see exactly\n"
489 " what size buffer was required. */\n"
490 "\\&\n"
491 " size++;\n"
492 "\\&\n"
493 " if (size E<gt> MAX_BUF) {\n"
494 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
495 " exit(EXIT_FAILURE);\n"
496 " }\n"
497 " }\n"
498 " } while (s == ERANGE);\n"
499 "\\&\n"
500 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
501 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
502 " strerror(s), size);\n"
503 "\\&\n"
504 " if (s != 0 || result == NULL) {\n"
505 " printf(\"Call failed/record not found\\[rs]n\");\n"
506 " exit(EXIT_FAILURE);\n"
507 " }\n"
508 "\\&\n"
509 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
510 " result_buf.s_name, result_buf.s_proto,\n"
511 " ntohs(result_buf.s_port));\n"
512 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
513 " printf(\"%s \", *p);\n"
514 " printf(\"\\[rs]n\");\n"
515 "\\&\n"
516 " exit(EXIT_SUCCESS);\n"
517 "}\n"
518 msgstr ""
519 "#define _GNU_SOURCE\n"
520 "#include E<lt>ctype.hE<gt>\n"
521 "#include E<lt>errno.hE<gt>\n"
522 "#include E<lt>netdb.hE<gt>\n"
523 "#include E<lt>stdio.hE<gt>\n"
524 "#include E<lt>stdlib.hE<gt>\n"
525 "#include E<lt>string.hE<gt>\n"
526 "\\&\n"
527 "#define MAX_BUF 10000\n"
528 "\\&\n"
529 "#define streq(...) (strcmp(__VA_ARGS__) == 0)\n"
530 "\\&\n"
531 "int\n"
532 "main(int argc, char *argv[])\n"
533 "{\n"
534 " int size, erange_cnt, port, s;\n"
535 " struct servent result_buf;\n"
536 " struct servent *result;\n"
537 " char buf[MAX_BUF];\n"
538 " char *protop;\n"
539 "\\&\n"
540 " if (argc E<lt> 3) {\n"
541 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
542 " exit(EXIT_FAILURE);\n"
543 " }\n"
544 "\\&\n"
545 " port = htons(atoi(argv[1]));\n"
546 " protop = (streq(argv[2], \"null\") ||\n"
547 " streq(argv[2], \"NULL\")) ? NULL : argv[2];\n"
548 "\\&\n"
549 " size = 1024;\n"
550 " if (argc E<gt> 3)\n"
551 " size = atoi(argv[3]);\n"
552 "\\&\n"
553 " if (size E<gt> MAX_BUF) {\n"
554 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
555 " exit(EXIT_FAILURE);\n"
556 " }\n"
557 "\\&\n"
558 " erange_cnt = 0;\n"
559 " do {\n"
560 " s = getservbyport_r(port, protop, &result_buf,\n"
561 " buf, size, &result);\n"
562 " if (s == ERANGE) {\n"
563 " if (erange_cnt == 0)\n"
564 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
565 " erange_cnt++;\n"
566 "\\&\n"
567 " /* Increment a byte at a time so we can see exactly\n"
568 " what size buffer was required. */\n"
569 "\\&\n"
570 " size++;\n"
571 "\\&\n"
572 " if (size E<gt> MAX_BUF) {\n"
573 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
574 " exit(EXIT_FAILURE);\n"
575 " }\n"
576 " }\n"
577 " } while (s == ERANGE);\n"
578 "\\&\n"
579 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
580 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
581 " strerror(s), size);\n"
582 "\\&\n"
583 " if (s != 0 || result == NULL) {\n"
584 " printf(\"Call failed/record not found\\[rs]n\");\n"
585 " exit(EXIT_FAILURE);\n"
586 " }\n"
587 "\\&\n"
588 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
589 " result_buf.s_name, result_buf.s_proto,\n"
590 " ntohs(result_buf.s_port));\n"
591 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
592 " printf(\"%s \", *p);\n"
593 " printf(\"\\[rs]n\");\n"
594 "\\&\n"
595 " exit(EXIT_SUCCESS);\n"
596 "}\n"
597
598 #. SRC END
599 #. type: SH
600 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
601 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
602 #, no-wrap
603 msgid "SEE ALSO"
604 msgstr "انظر أيضًا"
605
606 #. type: Plain text
607 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
608 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
609 msgid "B<getservent>(3), B<services>(5)"
610 msgstr "B<getservent>(3), B<services>(5)"
611
612 #. type: TH
613 #: debian-trixie
614 #, no-wrap
615 msgid "2024-06-15"
616 msgstr "15 يونيو 2024"
617
618 #. type: TH
619 #: debian-trixie
620 #, no-wrap
621 msgid "Linux man-pages 6.9.1"
622 msgstr "صفحات دليل لينكس 6.9.1"
623
624 #. type: Plain text
625 #: debian-trixie
626 msgid "Standard C library (I<libc>, I<-lc>)"
627 msgstr "مكتبة سي المعيارية (I<libc>، I<-lc>)"
628
629 #. type: Plain text
630 #: debian-trixie
631 #, no-wrap
632 msgid ""
633 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
634 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
635 "B< struct servent **restrict >I<result>B<);>\n"
636 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
637 "B< const char *restrict >I<proto>B<,>\n"
638 "B< struct servent *restrict >I<result_buf>B<,>\n"
639 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
640 "B< struct servent **restrict >I<result>B<);>\n"
641 "B<int getservbyport_r(int >I<port>B<,>\n"
642 "B< const char *restrict >I<proto>B<,>\n"
643 "B< struct servent *restrict >I<result_buf>B<,>\n"
644 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
645 "B< struct servent **restrict >I<result>B<);>\n"
646 msgstr ""
647 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
648 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
649 "B< struct servent **restrict >I<result>B<);>\n"
650 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
651 "B< const char *restrict >I<proto>B<,>\n"
652 "B< struct servent *restrict >I<result_buf>B<,>\n"
653 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
654 "B< struct servent **restrict >I<result>B<);>\n"
655 "B<int getservbyport_r(int >I<port>B<,>\n"
656 "B< const char *restrict >I<proto>B<,>\n"
657 "B< struct servent *restrict >I<result_buf>B<,>\n"
658 "B< char >I<buf>B<[restrict .>I<buflen>B<], size_t >I<buflen>B<,>\n"
659 "B< struct servent **restrict >I<result>B<);>\n"
660
661 #. I can find no information on the required/recommended buffer size;
662 #. the nonreentrant functions use a 1024 byte buffer -- mtk.
663 #. type: Plain text
664 #: debian-trixie
665 msgid ""
666 "The I<buf> array is used to store the string fields pointed to by the "
667 "returned I<servent> structure. (The nonreentrant functions allocate these "
668 "strings in static storage.) The size of this array is specified in "
669 "I<buflen>. If I<buf> is too small, the call fails with the error B<ERANGE>, "
670 "and the caller must try again with a larger buffer. (A buffer of length "
671 "1024 bytes should be sufficient for most applications.)"
672 msgstr ""
673 "تُستخدم المصفوفة I<buf> لتخزين حقول السلاسل المحارف المشار إليها بواسطة بنية "
674 "I<servent> المُرجعة. (تخصص الدوال غير القابلة لإعادة الدخول هذه السلاسل في "
675 "تخزين ثابت.) يُحدد حجم هذه المصفوفة في I<buflen>. إذا كانت I<buf> صغيرة جدًا، "
676 "يفشل الاستدعاء مع الخطأ B<ERANGE>، ويجب على المستدعي المحاولة مرة أخرى بمخزن "
677 "مؤقت أكبر. (يجب أن يكون مخزن مؤقت بطول 1024 بايت كافيًا لمعظم التطبيقات.)"
678
679 #. type: Plain text
680 #: debian-trixie
681 msgid ""
682 "I<buf> is too small. Try again with a larger buffer (and increased "
683 "I<buflen>)."
684 msgstr ""
685 "المخزن المؤقت I<buf> صغير جدًا. حاول مرة أخرى بمخزن أكبر (وزيادة I<buflen>)."
686
687 #. type: Plain text
688 #: debian-trixie
689 msgid ""
690 "The program below uses B<getservbyport_r>() to retrieve the service record "
691 "for the port and protocol named in its first command-line argument. If a "
692 "third (integer) command-line argument is supplied, it is used as the initial "
693 "value for I<buflen>; if B<getservbyport_r>() fails with the error "
694 "B<ERANGE>, the program retries with larger buffer sizes. The following "
695 "shell session shows a couple of sample runs:"
696 msgstr ""
697 "يستخدم البرنامج أدناه B<getservbyport_r>() لاسترداد سجل الخدمة للمنفذ "
698 "والبروتوكول المذكورين في وسيطة سطر الأوامر الأولى. إذا تم توفير وسيطة سطر "
699 "أوامر ثالثة (عدد صحيح)، فتُستخدم كقيمة مبدئية لـ I<buflen>؛ إذا فشل "
700 "B<getservbyport_r>() مع الخطأ B<ERANGE>، يعيد البرنامج المحاولة بأحجام مخزن "
701 "مؤقت أكبر. تُظهر جلسة الصدفة التالية بعض الأمثلة على التشغيل:"
702
703 #. type: Plain text
704 #: debian-trixie
705 #, no-wrap
706 msgid ""
707 "$B< ./a.out 7 tcp 1>\n"
708 "ERANGE! Retrying with larger buffer\n"
709 "getservbyport_r() returned: 0 (success) (buflen=87)\n"
710 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
711 "$B< ./a.out 77777 tcp>\n"
712 "getservbyport_r() returned: 0 (success) (buflen=1024)\n"
713 "Call failed/record not found\n"
714 msgstr ""
715 "$B< ./a.out 7 tcp 1>\n"
716 "ERANGE! Retrying with larger buffer\n"
717 "getservbyport_r() returned: 0 (success) (buflen=87)\n"
718 "s_name=echo; s_proto=tcp; s_port=7; aliases=\n"
719 "$B< ./a.out 77777 tcp>\n"
720 "getservbyport_r() returned: 0 (success) (buflen=1024)\n"
721 "Call failed/record not found\n"
722
723 #. type: Plain text
724 #: debian-trixie
725 #, no-wrap
726 msgid ""
727 "#define _GNU_SOURCE\n"
728 "#include E<lt>ctype.hE<gt>\n"
729 "#include E<lt>errno.hE<gt>\n"
730 "#include E<lt>netdb.hE<gt>\n"
731 "#include E<lt>stdio.hE<gt>\n"
732 "#include E<lt>stdlib.hE<gt>\n"
733 "#include E<lt>string.hE<gt>\n"
734 "\\&\n"
735 "#define MAX_BUF 10000\n"
736 "\\&\n"
737 "int\n"
738 "main(int argc, char *argv[])\n"
739 "{\n"
740 " int buflen, erange_cnt, port, s;\n"
741 " struct servent result_buf;\n"
742 " struct servent *result;\n"
743 " char buf[MAX_BUF];\n"
744 " char *protop;\n"
745 "\\&\n"
746 " if (argc E<lt> 3) {\n"
747 " printf(\"Usage: %s port-num proto-name [buflen]\\[rs]n\", argv[0]);\n"
748 " exit(EXIT_FAILURE);\n"
749 " }\n"
750 "\\&\n"
751 " port = htons(atoi(argv[1]));\n"
752 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
753 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
754 "\\&\n"
755 " buflen = 1024;\n"
756 " if (argc E<gt> 3)\n"
757 " buflen = atoi(argv[3]);\n"
758 "\\&\n"
759 " if (buflen E<gt> MAX_BUF) {\n"
760 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
761 " exit(EXIT_FAILURE);\n"
762 " }\n"
763 "\\&\n"
764 " erange_cnt = 0;\n"
765 " do {\n"
766 " s = getservbyport_r(port, protop, &result_buf,\n"
767 " buf, buflen, &result);\n"
768 " if (s == ERANGE) {\n"
769 " if (erange_cnt == 0)\n"
770 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
771 " erange_cnt++;\n"
772 "\\&\n"
773 " /* Increment a byte at a time so we can see exactly\n"
774 " what size buffer was required. */\n"
775 "\\&\n"
776 " buflen++;\n"
777 "\\&\n"
778 " if (buflen E<gt> MAX_BUF) {\n"
779 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
780 " exit(EXIT_FAILURE);\n"
781 " }\n"
782 " }\n"
783 " } while (s == ERANGE);\n"
784 "\\&\n"
785 " printf(\"getservbyport_r() returned: %s (buflen=%d)\\[rs]n\",\n"
786 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
787 " strerror(s), buflen);\n"
788 "\\&\n"
789 " if (s != 0 || result == NULL) {\n"
790 " printf(\"Call failed/record not found\\[rs]n\");\n"
791 " exit(EXIT_FAILURE);\n"
792 " }\n"
793 "\\&\n"
794 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
795 " result_buf.s_name, result_buf.s_proto,\n"
796 " ntohs(result_buf.s_port));\n"
797 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
798 " printf(\"%s \", *p);\n"
799 " printf(\"\\[rs]n\");\n"
800 "\\&\n"
801 " exit(EXIT_SUCCESS);\n"
802 "}\n"
803 msgstr ""
804 "#define _GNU_SOURCE\n"
805 "#include E<lt>ctype.hE<gt>\n"
806 "#include E<lt>errno.hE<gt>\n"
807 "#include E<lt>netdb.hE<gt>\n"
808 "#include E<lt>stdio.hE<gt>\n"
809 "#include E<lt>stdlib.hE<gt>\n"
810 "#include E<lt>string.hE<gt>\n"
811 "\\&\n"
812 "#define MAX_BUF 10000\n"
813 "\\&\n"
814 "int\n"
815 "main(int argc, char *argv[])\n"
816 "{\n"
817 " int buflen, erange_cnt, port, s;\n"
818 " struct servent result_buf;\n"
819 " struct servent *result;\n"
820 " char buf[MAX_BUF];\n"
821 " char *protop;\n"
822 "\\&\n"
823 " if (argc E<lt> 3) {\n"
824 " printf(\"Usage: %s port-num proto-name [buflen]\\[rs]n\", argv[0]);\n"
825 " exit(EXIT_FAILURE);\n"
826 " }\n"
827 "\\&\n"
828 " port = htons(atoi(argv[1]));\n"
829 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
830 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
831 "\\&\n"
832 " buflen = 1024;\n"
833 " if (argc E<gt> 3)\n"
834 " buflen = atoi(argv[3]);\n"
835 "\\&\n"
836 " if (buflen E<gt> MAX_BUF) {\n"
837 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
838 " exit(EXIT_FAILURE);\n"
839 " }\n"
840 "\\&\n"
841 " erange_cnt = 0;\n"
842 " do {\n"
843 " s = getservbyport_r(port, protop, &result_buf,\n"
844 " buf, buflen, &result);\n"
845 " if (s == ERANGE) {\n"
846 " if (erange_cnt == 0)\n"
847 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
848 " erange_cnt++;\n"
849 "\\&\n"
850 " /* Increment a byte at a time so we can see exactly\n"
851 " what size buffer was required. */\n"
852 "\\&\n"
853 " buflen++;\n"
854 "\\&\n"
855 " if (buflen E<gt> MAX_BUF) {\n"
856 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
857 " exit(EXIT_FAILURE);\n"
858 " }\n"
859 " }\n"
860 " } while (s == ERANGE);\n"
861 "\\&\n"
862 " printf(\"getservbyport_r() returned: %s (buflen=%d)\\[rs]n\",\n"
863 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
864 " strerror(s), buflen);\n"
865 "\\&\n"
866 " if (s != 0 || result == NULL) {\n"
867 " printf(\"Call failed/record not found\\[rs]n\");\n"
868 " exit(EXIT_FAILURE);\n"
869 " }\n"
870 "\\&\n"
871 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
872 " result_buf.s_name, result_buf.s_proto,\n"
873 " ntohs(result_buf.s_port));\n"
874 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
875 " printf(\"%s \", *p);\n"
876 " printf(\"\\[rs]n\");\n"
877 "\\&\n"
878 " exit(EXIT_SUCCESS);\n"
879 "}\n"
880
881 #. type: TH
882 #: fedora-44 fedora-rawhide
883 #, no-wrap
884 msgid "2024-12-24"
885 msgstr "24 ديسمبر 2024"
886
887 #. type: TH
888 #: fedora-44 fedora-rawhide
889 #, no-wrap
890 msgid "Linux man-pages 6.13"
891 msgstr "صفحات دليل لينكس 6.13"
892
893 #. type: Plain text
894 #: fedora-44 fedora-rawhide
895 #, no-wrap
896 msgid ""
897 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
898 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
899 "B< struct servent **restrict >I<result>B<);>\n"
900 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
901 "B< const char *restrict >I<proto>B<,>\n"
902 "B< struct servent *restrict >I<result_buf>B<,>\n"
903 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
904 "B< struct servent **restrict >I<result>B<);>\n"
905 "B<int getservbyport_r(int >I<port>B<,>\n"
906 "B< const char *restrict >I<proto>B<,>\n"
907 "B< struct servent *restrict >I<result_buf>B<,>\n"
908 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
909 "B< struct servent **restrict >I<result>B<);>\n"
910 msgstr ""
911 "B<int getservent_r(struct servent *restrict >I<result_buf>B<,>\n"
912 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
913 "B< struct servent **restrict >I<result>B<);>\n"
914 "B<int getservbyname_r(const char *restrict >I<name>B<,>\n"
915 "B< const char *restrict >I<proto>B<,>\n"
916 "B< struct servent *restrict >I<result_buf>B<,>\n"
917 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
918 "B< struct servent **restrict >I<result>B<);>\n"
919 "B<int getservbyport_r(int >I<port>B<,>\n"
920 "B< const char *restrict >I<proto>B<,>\n"
921 "B< struct servent *restrict >I<result_buf>B<,>\n"
922 "B< char >I<buf>B<[restrict .>I<size>B<], size_t >I<size>B<,>\n"
923 "B< struct servent **restrict >I<result>B<);>\n"
924
925 #. type: Plain text
926 #: fedora-44 fedora-rawhide
927 #, no-wrap
928 msgid ""
929 "#define _GNU_SOURCE\n"
930 "#include E<lt>ctype.hE<gt>\n"
931 "#include E<lt>errno.hE<gt>\n"
932 "#include E<lt>netdb.hE<gt>\n"
933 "#include E<lt>stdio.hE<gt>\n"
934 "#include E<lt>stdlib.hE<gt>\n"
935 "#include E<lt>string.hE<gt>\n"
936 "\\&\n"
937 "#define MAX_BUF 10000\n"
938 "\\&\n"
939 "int\n"
940 "main(int argc, char *argv[])\n"
941 "{\n"
942 " int size, erange_cnt, port, s;\n"
943 " struct servent result_buf;\n"
944 " struct servent *result;\n"
945 " char buf[MAX_BUF];\n"
946 " char *protop;\n"
947 "\\&\n"
948 " if (argc E<lt> 3) {\n"
949 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
950 " exit(EXIT_FAILURE);\n"
951 " }\n"
952 "\\&\n"
953 " port = htons(atoi(argv[1]));\n"
954 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
955 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
956 "\\&\n"
957 " size = 1024;\n"
958 " if (argc E<gt> 3)\n"
959 " size = atoi(argv[3]);\n"
960 "\\&\n"
961 " if (size E<gt> MAX_BUF) {\n"
962 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
963 " exit(EXIT_FAILURE);\n"
964 " }\n"
965 "\\&\n"
966 " erange_cnt = 0;\n"
967 " do {\n"
968 " s = getservbyport_r(port, protop, &result_buf,\n"
969 " buf, size, &result);\n"
970 " if (s == ERANGE) {\n"
971 " if (erange_cnt == 0)\n"
972 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
973 " erange_cnt++;\n"
974 "\\&\n"
975 " /* Increment a byte at a time so we can see exactly\n"
976 " what size buffer was required. */\n"
977 "\\&\n"
978 " size++;\n"
979 "\\&\n"
980 " if (size E<gt> MAX_BUF) {\n"
981 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
982 " exit(EXIT_FAILURE);\n"
983 " }\n"
984 " }\n"
985 " } while (s == ERANGE);\n"
986 "\\&\n"
987 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
988 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
989 " strerror(s), size);\n"
990 "\\&\n"
991 " if (s != 0 || result == NULL) {\n"
992 " printf(\"Call failed/record not found\\[rs]n\");\n"
993 " exit(EXIT_FAILURE);\n"
994 " }\n"
995 "\\&\n"
996 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
997 " result_buf.s_name, result_buf.s_proto,\n"
998 " ntohs(result_buf.s_port));\n"
999 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1000 " printf(\"%s \", *p);\n"
1001 " printf(\"\\[rs]n\");\n"
1002 "\\&\n"
1003 " exit(EXIT_SUCCESS);\n"
1004 "}\n"
1005 msgstr ""
1006 "#define _GNU_SOURCE\n"
1007 "#include E<lt>ctype.hE<gt>\n"
1008 "#include E<lt>errno.hE<gt>\n"
1009 "#include E<lt>netdb.hE<gt>\n"
1010 "#include E<lt>stdio.hE<gt>\n"
1011 "#include E<lt>stdlib.hE<gt>\n"
1012 "#include E<lt>string.hE<gt>\n"
1013 "\\&\n"
1014 "#define MAX_BUF 10000\n"
1015 "\\&\n"
1016 "int\n"
1017 "main(int argc, char *argv[])\n"
1018 "{\n"
1019 " int size, erange_cnt, port, s;\n"
1020 " struct servent result_buf;\n"
1021 " struct servent *result;\n"
1022 " char buf[MAX_BUF];\n"
1023 " char *protop;\n"
1024 "\\&\n"
1025 " if (argc E<lt> 3) {\n"
1026 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
1027 " exit(EXIT_FAILURE);\n"
1028 " }\n"
1029 "\\&\n"
1030 " port = htons(atoi(argv[1]));\n"
1031 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
1032 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
1033 "\\&\n"
1034 " size = 1024;\n"
1035 " if (argc E<gt> 3)\n"
1036 " size = atoi(argv[3]);\n"
1037 "\\&\n"
1038 " if (size E<gt> MAX_BUF) {\n"
1039 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1040 " exit(EXIT_FAILURE);\n"
1041 " }\n"
1042 "\\&\n"
1043 " erange_cnt = 0;\n"
1044 " do {\n"
1045 " s = getservbyport_r(port, protop, &result_buf,\n"
1046 " buf, size, &result);\n"
1047 " if (s == ERANGE) {\n"
1048 " if (erange_cnt == 0)\n"
1049 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
1050 " erange_cnt++;\n"
1051 "\\&\n"
1052 " /* Increment a byte at a time so we can see exactly\n"
1053 " what size buffer was required. */\n"
1054 "\\&\n"
1055 " size++;\n"
1056 "\\&\n"
1057 " if (size E<gt> MAX_BUF) {\n"
1058 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1059 " exit(EXIT_FAILURE);\n"
1060 " }\n"
1061 " }\n"
1062 " } while (s == ERANGE);\n"
1063 "\\&\n"
1064 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
1065 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
1066 " strerror(s), size);\n"
1067 "\\&\n"
1068 " if (s != 0 || result == NULL) {\n"
1069 " printf(\"Call failed/record not found\\[rs]n\");\n"
1070 " exit(EXIT_FAILURE);\n"
1071 " }\n"
1072 "\\&\n"
1073 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
1074 " result_buf.s_name, result_buf.s_proto,\n"
1075 " ntohs(result_buf.s_port));\n"
1076 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1077 " printf(\"%s \", *p);\n"
1078 " printf(\"\\[rs]n\");\n"
1079 "\\&\n"
1080 " exit(EXIT_SUCCESS);\n"
1081 "}\n"
1082
1083 #. type: TH
1084 #: mageia-cauldron
1085 #, no-wrap
1086 msgid "2025-09-21"
1087 msgstr "21 سبتمبر 2025"
1088
1089 #. type: TH
1090 #: mageia-cauldron
1091 #, no-wrap
1092 msgid "Linux man-pages 6.17"
1093 msgstr "صفحات دليل لينكس 6.17"
1094
1095 #. type: Plain text
1096 #: mageia-cauldron
1097 #, no-wrap
1098 msgid ""
1099 "#define _GNU_SOURCE\n"
1100 "#include E<lt>ctype.hE<gt>\n"
1101 "#include E<lt>errno.hE<gt>\n"
1102 "#include E<lt>netdb.hE<gt>\n"
1103 "#include E<lt>stdio.hE<gt>\n"
1104 "#include E<lt>stdlib.hE<gt>\n"
1105 "#include E<lt>string.hE<gt>\n"
1106 "\\&\n"
1107 "#define MAX_BUF 10000\n"
1108 "\\&\n"
1109 "int\n"
1110 "main(int argc, char *argv[])\n"
1111 "{\n"
1112 " int size, erange_cnt, port, s;\n"
1113 " struct servent result_buf;\n"
1114 " struct servent *result;\n"
1115 " char buf[MAX_BUF];\n"
1116 " char *protop;\n"
1117 "\\&\n"
1118 " if (argc E<lt> 3) {\n"
1119 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
1120 " exit(EXIT_FAILURE);\n"
1121 " }\n"
1122 "\\&\n"
1123 " port = htons(atoi(argv[1]));\n"
1124 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
1125 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
1126 "\\&\n"
1127 " size = 1024;\n"
1128 " if (argc E<gt> 3)\n"
1129 " size = atoi(argv[3]);\n"
1130 "\\&\n"
1131 " if (size E<gt> MAX_BUF) {\n"
1132 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1133 " exit(EXIT_FAILURE);\n"
1134 " }\n"
1135 "\\&\n"
1136 " erange_cnt = 0;\n"
1137 " do {\n"
1138 " s = getservbyport_r(port, protop, &result_buf,\n"
1139 " buf, size, &result);\n"
1140 " if (s == ERANGE) {\n"
1141 " if (erange_cnt == 0)\n"
1142 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
1143 " erange_cnt++;\n"
1144 "\\&\n"
1145 " /* Increment a byte at a time so we can see exactly\n"
1146 " what size buffer was required. */\n"
1147 "\\&\n"
1148 " size++;\n"
1149 "\\&\n"
1150 " if (size E<gt> MAX_BUF) {\n"
1151 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1152 " exit(EXIT_FAILURE);\n"
1153 " }\n"
1154 " }\n"
1155 " } while (s == ERANGE);\n"
1156 "\\&\n"
1157 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
1158 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
1159 " strerror(s), size);\n"
1160 "\\&\n"
1161 " if (s != 0 || result == NULL) {\n"
1162 " printf(\"Call failed/record not found\\[rs]n\");\n"
1163 " exit(EXIT_FAILURE);\n"
1164 " }\n"
1165 "\\&\n"
1166 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
1167 " result_buf.s_name, result_buf.s_proto,\n"
1168 " ntohs(result_buf.s_port));\n"
1169 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1170 " printf(\"%s \", *p);\n"
1171 " printf(\"\\[rs]n\");\n"
1172 "\\&\n"
1173 " exit(EXIT_SUCCESS);\n"
1174 "}\n"
1175 msgstr ""
1176 "#define _GNU_SOURCE\n"
1177 "#include E<lt>ctype.hE<gt>\n"
1178 "#include E<lt>errno.hE<gt>\n"
1179 "#include E<lt>netdb.hE<gt>\n"
1180 "#include E<lt>stdio.hE<gt>\n"
1181 "#include E<lt>stdlib.hE<gt>\n"
1182 "#include E<lt>string.hE<gt>\n"
1183 "\\&\n"
1184 "#define MAX_BUF 10000\n"
1185 "\\&\n"
1186 "int\n"
1187 "main(int argc, char *argv[])\n"
1188 "{\n"
1189 " int size, erange_cnt, port, s;\n"
1190 " struct servent result_buf;\n"
1191 " struct servent *result;\n"
1192 " char buf[MAX_BUF];\n"
1193 " char *protop;\n"
1194 "\\&\n"
1195 " if (argc E<lt> 3) {\n"
1196 " printf(\"Usage: %s port-num proto-name [size]\\[rs]n\", argv[0]);\n"
1197 " exit(EXIT_FAILURE);\n"
1198 " }\n"
1199 "\\&\n"
1200 " port = htons(atoi(argv[1]));\n"
1201 " protop = (strcmp(argv[2], \"null\") == 0 ||\n"
1202 " strcmp(argv[2], \"NULL\") == 0) ? NULL : argv[2];\n"
1203 "\\&\n"
1204 " size = 1024;\n"
1205 " if (argc E<gt> 3)\n"
1206 " size = atoi(argv[3]);\n"
1207 "\\&\n"
1208 " if (size E<gt> MAX_BUF) {\n"
1209 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1210 " exit(EXIT_FAILURE);\n"
1211 " }\n"
1212 "\\&\n"
1213 " erange_cnt = 0;\n"
1214 " do {\n"
1215 " s = getservbyport_r(port, protop, &result_buf,\n"
1216 " buf, size, &result);\n"
1217 " if (s == ERANGE) {\n"
1218 " if (erange_cnt == 0)\n"
1219 " printf(\"ERANGE! Retrying with larger buffer\\[rs]n\");\n"
1220 " erange_cnt++;\n"
1221 "\\&\n"
1222 " /* Increment a byte at a time so we can see exactly\n"
1223 " what size buffer was required. */\n"
1224 "\\&\n"
1225 " size++;\n"
1226 "\\&\n"
1227 " if (size E<gt> MAX_BUF) {\n"
1228 " printf(\"Exceeded buffer limit (%d)\\[rs]n\", MAX_BUF);\n"
1229 " exit(EXIT_FAILURE);\n"
1230 " }\n"
1231 " }\n"
1232 " } while (s == ERANGE);\n"
1233 "\\&\n"
1234 " printf(\"getservbyport_r() returned: %s (size=%d)\\[rs]n\",\n"
1235 " (s == 0) ? \"0 (success)\" : (s == ENOENT) ? \"ENOENT\" :\n"
1236 " strerror(s), size);\n"
1237 "\\&\n"
1238 " if (s != 0 || result == NULL) {\n"
1239 " printf(\"Call failed/record not found\\[rs]n\");\n"
1240 " exit(EXIT_FAILURE);\n"
1241 " }\n"
1242 "\\&\n"
1243 " printf(\"s_name=%s; s_proto=%s; s_port=%d; aliases=\",\n"
1244 " result_buf.s_name, result_buf.s_proto,\n"
1245 " ntohs(result_buf.s_port));\n"
1246 " for (char **p = result_buf.s_aliases; *p != NULL; p++)\n"
1247 " printf(\"%s \", *p);\n"
1248 " printf(\"\\[rs]n\");\n"
1249 "\\&\n"
1250 " exit(EXIT_SUCCESS);\n"
1251 "}\n"
1252
1253 #. type: TH
1254 #: opensuse-leap-16-1 opensuse-tumbleweed
1255 #, no-wrap
1256 msgid "Linux man-pages (unreleased)"
1257 msgstr "صفحات دليل لينكس (لم تصدر بعد)"