Debian Codegraph @

po/ro/man3/sem_wait.3.po

raw
1 # Romanian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Remus-Gabriel Chelu <[email protected]>, 2024, 2025.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.24.0\n"
8 "POT-Creation-Date: 2026-06-05 06:42+0200\n"
9 "PO-Revision-Date: 2025-11-05 21:13+0100\n"
10 "Last-Translator: Remus-Gabriel Chelu <[email protected]>\n"
11 "Language-Team: Romanian <[email protected]>\n"
12 "Language: ro\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=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
17 "20)) ? 1 : 2;\n"
18 "X-Generator: Poedit 3.6\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 "sem_wait"
25 msgstr "sem_wait"
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 februarie 2026"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "Pagini de manual de Linux 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 "NUME"
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 "sem_wait, sem_timedwait, sem_trywait - lock a semaphore"
51 msgstr "sem_wait, sem_timedwait, sem_trywait - blochează un semafor"
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 "BIBLIOTECA"
59
60 #. type: Plain text
61 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
62 #: opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "POSIX threads library (I<libpthread>,\\ I<-lpthread>)"
64 msgstr "Biblioteca de fire de execuție POSIX (I<libpthread>, I<-lpthread>)"
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 "SINOPSIS"
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>semaphore.hE<gt>>\n"
78 msgstr "B<#include E<lt>semaphore.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 ""
85 "B<int sem_wait(sem_t *>I<sem>B<);>\n"
86 "B<int sem_trywait(sem_t *>I<sem>B<);>\n"
87 "B<int sem_timedwait(sem_t *restrict >I<sem>B<,>\n"
88 "B< const struct timespec *restrict >I<abs_timeout>B<);>\n"
89 msgstr ""
90 "B<int sem_wait(sem_t *>I<sem>B<);>\n"
91 "B<int sem_trywait(sem_t *>I<sem>B<);>\n"
92 "B<int sem_timedwait(sem_t *restrict >I<sem>B<,>\n"
93 "B< const struct timespec *restrict >I<abs_timeout>B<);>\n"
94
95 #. type: Plain text
96 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
97 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
98 msgid ""
99 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
100 msgstr ""
101 "Cerințe pentru macrocomenzi de testare a caracteristicilor pentru glibc "
102 "(consultați B<feature_test_macros>(7)):"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 msgid "B<sem_timedwait>():"
108 msgstr "B<sem_timedwait>():"
109
110 #. type: Plain text
111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
113 #, no-wrap
114 msgid " _POSIX_C_SOURCE E<gt>= 200112L\n"
115 msgstr " _POSIX_C_SOURCE E<gt>= 200112L\n"
116
117 #. type: SH
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 #, no-wrap
121 msgid "DESCRIPTION"
122 msgstr "DESCRIERE"
123
124 #. type: Plain text
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 msgid ""
128 "B<sem_wait>() decrements (locks) the semaphore pointed to by I<sem>. If "
129 "the semaphore's value is greater than zero, then the decrement proceeds, and "
130 "the function returns, immediately. If the semaphore currently has the value "
131 "zero, then the call blocks until either it becomes possible to perform the "
132 "decrement (i.e., the semaphore value rises above zero), or a signal handler "
133 "interrupts the call."
134 msgstr ""
135 "B<sem_wait>() decrementează (blochează) semaforul indicat de I<sem>. În "
136 "cazul în care valoarea semaforului este mai mare decât zero, atunci "
137 "decrementarea are loc, iar funcția returnează, imediat. În cazul în care "
138 "semaforul are în prezent valoarea zero, apelul se blochează până când fie "
139 "devine posibilă efectuarea decrementării (de exemplu, valoarea semaforului "
140 "crește peste zero), fie un gestionar de semnal întrerupe apelul."
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 msgid ""
146 "B<sem_trywait>() is the same as B<sem_wait>(), except that if the decrement "
147 "cannot be immediately performed, then call returns an error (I<errno> set to "
148 "B<EAGAIN>) instead of blocking."
149 msgstr ""
150 "B<sem_trywait>() este la fel ca B<sem_wait>(), cu excepția faptului că, dacă "
151 "decrementarea nu poate fi efectuată imediat, apelul returnează o eroare "
152 "(I<errno> este configurată la B<EAGAIN>) în loc să blocheze."
153
154 #. type: Plain text
155 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
156 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
157 msgid ""
158 "B<sem_timedwait>() is the same as B<sem_wait>(), except that I<abs_timeout> "
159 "specifies a limit on the amount of time that the call should block if the "
160 "decrement cannot be immediately performed. The I<abs_timeout> argument "
161 "points to a B<timespec>(3) structure that specifies an absolute timeout in "
162 "seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)."
163 msgstr ""
164 "B<sem_timedwait>() este la fel ca B<sem_wait>(), cu excepția faptului că "
165 "I<abs_timeout> specifică o limită de timp în care apelul trebuie blocat dacă "
166 "decrementarea nu poate fi efectuată imediat. Argumentul I<abs_timeout> "
167 "indică o structură B<timespec>(3) care specifică un timp de așteptare "
168 "absolut în secunde și nanosecunde de la Epoch, 1970-01-01 00:00:00 +0000 "
169 "(UTC)."
170
171 #. type: Plain text
172 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
173 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
174 msgid ""
175 "If the timeout has already expired by the time of the call, and the "
176 "semaphore could not be locked immediately, then B<sem_timedwait>() fails "
177 "with a timeout error (I<errno> set to B<ETIMEDOUT>)."
178 msgstr ""
179 "Dacă timpul de așteptare a expirat deja în momentul apelului, iar semaforul "
180 "nu a putut fi blocat imediat, atunci B<sem_timedwait>() eșuează cu o eroare "
181 "de timp (I<errno> este configurată la B<ETIMEDOUT>)."
182
183 #. type: Plain text
184 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
185 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
186 msgid ""
187 "If the operation can be performed immediately, then B<sem_timedwait>() "
188 "never fails with a timeout error, regardless of the value of "
189 "I<abs_timeout>. Furthermore, the validity of I<abs_timeout> is not checked "
190 "in this case."
191 msgstr ""
192 "Dacă operația poate fi efectuată imediat, atunci B<sem_timedwait>() nu "
193 "eșuează niciodată cu o eroare de timp de așteptare, indiferent de valoarea "
194 "lui I<abs_timeout>. În plus, validitatea lui I<abs_timeout> nu este "
195 "verificată în acest caz."
196
197 #. type: SH
198 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
199 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
200 #, no-wrap
201 msgid "RETURN VALUE"
202 msgstr "VALOAREA RETURNATĂ"
203
204 #. type: Plain text
205 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
206 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
207 msgid ""
208 "All of these functions return 0 on success; on error, the value of the "
209 "semaphore is left unchanged, -1 is returned, and I<errno> is set to indicate "
210 "the error."
211 msgstr ""
212 "Toate aceste funcții returnează 0 în caz de succes; în caz de eroare, "
213 "valoarea semaforului rămâne neschimbată, se returnează -1, iar I<errno> este "
214 "configurată pentru a indica eroarea."
215
216 #. type: SH
217 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
218 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
219 #, no-wrap
220 msgid "ERRORS"
221 msgstr "ERORI-IEȘIRE"
222
223 #. type: TP
224 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
225 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
226 #, no-wrap
227 msgid "B<EAGAIN>"
228 msgstr "B<EAGAIN>"
229
230 #. type: Plain text
231 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
232 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
233 msgid ""
234 "(B<sem_trywait>()) The operation could not be performed without blocking "
235 "(i.e., the semaphore currently has the value zero)."
236 msgstr ""
237 "(B<sem_trywait>()) Operația nu a putut fi efectuată fără blocare (de "
238 "exemplu, semaforul are în prezent valoarea zero)."
239
240 #. type: TP
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 #, no-wrap
244 msgid "B<EINTR>"
245 msgstr "B<EINTR>"
246
247 #. type: Plain text
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 msgid "The call was interrupted by a signal handler; see B<signal>(7)."
251 msgstr ""
252 "Apelul a fost întrerupt de un gestionar de semnal; a se vedea B<signal>(7)."
253
254 #. type: TP
255 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
256 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
257 #, no-wrap
258 msgid "B<EINVAL>"
259 msgstr "B<EINVAL>"
260
261 #. type: Plain text
262 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
263 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
264 msgid "I<sem> is not a valid semaphore."
265 msgstr "I<semafor> nu este un semafor valid."
266
267 #. type: Plain text
268 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
269 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
270 msgid ""
271 "(B<sem_timedwait>()) The value of I<abs_timeout.tv_nsecs> is less than 0, "
272 "or greater than or equal to 1000 million."
273 msgstr ""
274 "(B<sem_timedwait>()) Valoarea I<abs_timeout.tv_nsecs> este mai mică decât 0 "
275 "sau mai mare sau egală cu 1000 de milioane."
276
277 #. type: TP
278 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
279 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
280 #, no-wrap
281 msgid "B<ETIMEDOUT>"
282 msgstr "B<ETIMEDOUT>"
283
284 #. POSIX.1-2001 also allows EDEADLK -- "A deadlock condition
285 #. was detected", but this does not occur on Linux(?).
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 "(B<sem_timedwait>()) The call timed out before the semaphore could be "
291 "locked."
292 msgstr ""
293 "(B<sem_timedwait>()) Apelul a expirat înainte ca semaforul să poată fi "
294 "blocat."
295
296 #. type: SH
297 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
298 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
299 #, no-wrap
300 msgid "ATTRIBUTES"
301 msgstr "ATRIBUTE"
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 ""
307 "For an explanation of the terms used in this section, see B<attributes>(7)."
308 msgstr ""
309 "Pentru o explicație a termenilor folosiți în această secțiune, a se vedea "
310 "B<attributes>(7)."
311
312 #. type: tbl table
313 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
314 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
315 #, no-wrap
316 msgid "Interface"
317 msgstr "Interfață"
318
319 #. type: tbl table
320 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
321 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
322 #, no-wrap
323 msgid "Attribute"
324 msgstr "Atribut"
325
326 #. type: tbl table
327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
329 #, no-wrap
330 msgid "Value"
331 msgstr "Valoare"
332
333 #. type: tbl table
334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
336 #, no-wrap
337 msgid ".na\n"
338 msgstr ".na\n"
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 ".nh\n"
345 msgstr ".nh\n"
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 ""
352 "B<sem_wait>(),\n"
353 "B<sem_trywait>(),\n"
354 "B<sem_timedwait>()"
355 msgstr ""
356 "B<sem_wait>(),\n"
357 "B<sem_trywait>(),\n"
358 "B<sem_timedwait>()"
359
360 #. type: tbl table
361 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
362 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
363 #, no-wrap
364 msgid "Thread safety"
365 msgstr "Siguranța firelor"
366
367 #. type: tbl table
368 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
369 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
370 #, no-wrap
371 msgid "MT-Safe"
372 msgstr "MT-Safe"
373
374 #. type: SH
375 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
376 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
377 #, no-wrap
378 msgid "STANDARDS"
379 msgstr "STANDARDE"
380
381 #. type: Plain text
382 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
383 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
384 msgid "POSIX.1-2008."
385 msgstr "POSIX.1-2008."
386
387 #. type: SH
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 #, no-wrap
391 msgid "HISTORY"
392 msgstr "ISTORIC"
393
394 #. type: Plain text
395 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
396 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
397 msgid "POSIX.1-2001."
398 msgstr "POSIX.1-2001."
399
400 #. type: SH
401 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
402 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
403 #, no-wrap
404 msgid "EXAMPLES"
405 msgstr "EXEMPLE"
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 "The (somewhat trivial) program shown below operates on an unnamed "
412 "semaphore. The program expects two command-line arguments. The first "
413 "argument specifies a seconds value that is used to set an alarm timer to "
414 "generate a B<SIGALRM> signal. This handler performs a B<sem_post>(3) to "
415 "increment the semaphore that is being waited on in I<main()> using "
416 "B<sem_timedwait>(). The second command-line argument specifies the length "
417 "of the timeout, in seconds, for B<sem_timedwait>(). The following shows "
418 "what happens on two different runs of the program:"
419 msgstr ""
420 "Programul (oarecum trivial) prezentat mai jos operează pe un semafor fără "
421 "nume. Programul așteaptă două argumente în linia de comandă. Primul argument "
422 "specifică o valoare în secunde care este utilizată pentru a configura un "
423 "temporizator de alarmă pentru a genera un semnal B<SIGALRM>. Acest gestionar "
424 "efectuează un B<sem_post>(3) pentru a incrementa semaforul care este "
425 "așteptat în I<main()> utilizând B<sem_timedwait>(). Al doilea argument din "
426 "linia de comandă specifică lungimea timpului de așteptare, în secunde, "
427 "pentru B<sem_timedwait>(). Ceea ce urmează arată ce se întâmplă la două "
428 "execuții diferite ale programului:"
429
430 #. type: Plain text
431 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
432 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
433 #, no-wrap
434 msgid ""
435 "$B< ./a.out 2 3>\n"
436 "About to call sem_timedwait()\n"
437 "sem_post() from handler\n"
438 "sem_timedwait() succeeded\n"
439 "$B< ./a.out 2 1>\n"
440 "About to call sem_timedwait()\n"
441 "sem_timedwait() timed out\n"
442 msgstr ""
443 "$B< ./a.out 2 3>\n"
444 "În curs de apelare a sem_timedwait()\n"
445 "sem_post() de la gestionar\n"
446 "sem_timedwait() a reușit\n"
447 "$B< ./a.out 2 1>\n"
448 "În curs de apelare a sem_timedwait()\n"
449 "ssem_timedwait() a expirat\n"
450
451 #. type: SS
452 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
453 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
454 #, no-wrap
455 msgid "Program source"
456 msgstr "Sursa programului"
457
458 #. type: Plain text
459 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
460 #: opensuse-tumbleweed
461 #, no-wrap
462 msgid ""
463 "#include E<lt>err.hE<gt>\n"
464 "#include E<lt>errno.hE<gt>\n"
465 "#include E<lt>semaphore.hE<gt>\n"
466 "#include E<lt>signal.hE<gt>\n"
467 "#include E<lt>stdio.hE<gt>\n"
468 "#include E<lt>stdlib.hE<gt>\n"
469 "#include E<lt>time.hE<gt>\n"
470 "#include E<lt>unistd.hE<gt>\n"
471 "\\&\n"
472 "#include E<lt>assert.hE<gt>\n"
473 "\\&\n"
474 "sem_t sem;\n"
475 "\\&\n"
476 "static void\n"
477 "handler(int sig)\n"
478 "{\n"
479 " write(STDOUT_FILENO, \"sem_post() from handler\\[rs]n\", 24);\n"
480 " if (sem_post(&sem) == -1) {\n"
481 " write(STDERR_FILENO, \"sem_post() failed\\[rs]n\", 18);\n"
482 " _exit(EXIT_FAILURE);\n"
483 " }\n"
484 "}\n"
485 "\\&\n"
486 "int\n"
487 "main(int argc, char *argv[])\n"
488 "{\n"
489 " struct sigaction sa;\n"
490 " struct timespec ts;\n"
491 " int s;\n"
492 "\\&\n"
493 " if (argc != 3) {\n"
494 " fprintf(stderr, \"Usage: %s E<lt>alarm-secsE<gt> E<lt>wait-secsE<gt>\\[rs]n\",\n"
495 " argv[0]);\n"
496 " exit(EXIT_FAILURE);\n"
497 " }\n"
498 "\\&\n"
499 " if (sem_init(&sem, 0, 0) == -1)\n"
500 " err(EXIT_FAILURE, \"sem_init\");\n"
501 "\\&\n"
502 " /* Establish SIGALRM handler; set alarm timer using argv[1]. */\n"
503 "\\&\n"
504 " sa.sa_handler = handler;\n"
505 " sigemptyset(&sa.sa_mask);\n"
506 " sa.sa_flags = 0;\n"
507 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
508 " err(EXIT_FAILURE, \"sigaction\");\n"
509 "\\&\n"
510 " alarm(atoi(argv[1]));\n"
511 "\\&\n"
512 " /* Calculate relative interval as current time plus\n"
513 " number of seconds given argv[2]. */\n"
514 "\\&\n"
515 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
516 " err(EXIT_FAILURE, \"clock_gettime\");\n"
517 "\\&\n"
518 " ts.tv_sec += atoi(argv[2]);\n"
519 "\\&\n"
520 " printf(\"%s() about to call sem_timedwait()\\[rs]n\", __func__);\n"
521 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
522 " continue; /* Restart if interrupted by handler. */\n"
523 "\\&\n"
524 " /* Check what happened. */\n"
525 "\\&\n"
526 " if (s == -1) {\n"
527 " if (errno == ETIMEDOUT)\n"
528 " printf(\"sem_timedwait() timed out\\[rs]n\");\n"
529 " else\n"
530 " perror(\"sem_timedwait\");\n"
531 " } else\n"
532 " printf(\"sem_timedwait() succeeded\\[rs]n\");\n"
533 "\\&\n"
534 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
535 "}\n"
536 msgstr ""
537 "#include E<lt>err.hE<gt>\n"
538 "#include E<lt>errno.hE<gt>\n"
539 "#include E<lt>semaphore.hE<gt>\n"
540 "#include E<lt>signal.hE<gt>\n"
541 "#include E<lt>stdio.hE<gt>\n"
542 "#include E<lt>stdlib.hE<gt>\n"
543 "#include E<lt>time.hE<gt>\n"
544 "#include E<lt>unistd.hE<gt>\n"
545 "\\&\n"
546 "#include E<lt>assert.hE<gt>\n"
547 "\\&\n"
548 "sem_t sem;\n"
549 "\\&\n"
550 "static void\n"
551 "handler(int sig)\n"
552 "{\n"
553 " write(STDOUT_FILENO, \"sem_post() de la gestionar\\[rs]n\", 24);\n"
554 " if (sem_post(&sem) == -1) {\n"
555 " write(STDERR_FILENO, \"sem_post() a eșuat\\[rs]n\", 18);\n"
556 " _exit(EXIT_FAILURE);\n"
557 " }\n"
558 "}\n"
559 "\\&\n"
560 "int\n"
561 "main(int argc, char *argv[])\n"
562 "{\n"
563 " struct sigaction sa;\n"
564 " struct timespec ts;\n"
565 " int s;\n"
566 "\\&\n"
567 " if (argc != 3) {\n"
568 " fprintf(stderr, \"Utilizare: %s E<lt>secunde-alarmăE<gt> E<lt>secunde-așteptareE<gt>\\[rs]n\",\n"
569 " argv[0]);\n"
570 " exit(EXIT_FAILURE);\n"
571 " }\n"
572 "\\&\n"
573 " if (sem_init(&sem, 0, 0) == -1)\n"
574 " err(EXIT_FAILURE, \"sem_init\");\n"
575 "\\&\n"
576 " /* Stabilește gestionarul SIGALRM; fixează temporizatorul de alarmă utilizând argv[1]. */\n"
577 "\\&\n"
578 " sa.sa_handler = handler;\n"
579 " sigemptyset(&sa.sa_mask);\n"
580 " sa.sa_flags = 0;\n"
581 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
582 " err(EXIT_FAILURE, \"sigaction\");\n"
583 "\\&\n"
584 " alarm(atoi(argv[1]));\n"
585 "\\&\n"
586 " /* Calculează intervalul relativ ca timp curent plus\n"
587 " numărul de secunde dat de argv[2]. */\n"
588 "\\&\n"
589 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
590 " herr(EXIT_FAILURE, \"clock_gettime\");\n"
591 "\\&\n"
592 " ts.tv_sec += atoi(argv[2]);\n"
593 "\\&\n"
594 " printf(\"%s() pe cale să apeleze sem_timedwait()\\[rs]n\", __func__);\n"
595 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
596 " continue; /* Repornește dacă este întrerupt de gestionar. */\n"
597 "\\&\n"
598 " /* Verifică ce s-a întâmplat. */\n"
599 "\\&\n"
600 " if (s == -1) {\n"
601 " if (errno == ETIMEDOUT)\n"
602 " printf(\"sem_timedwait() timed out\\[rs]n\");\n"
603 " else\n"
604 " perror(\"sem_timedwait\");\n"
605 " } else\n"
606 " printf(\"sem_timedwait() a reușit\\[rs]n\");\n"
607 "\\&\n"
608 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
609 "}\n"
610
611 #. SRC END
612 #. type: SH
613 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
614 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
615 #, no-wrap
616 msgid "SEE ALSO"
617 msgstr "CONSULTAȚI ȘI"
618
619 #. type: Plain text
620 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
621 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
622 msgid ""
623 "B<clock_gettime>(2), B<sem_getvalue>(3), B<sem_post>(3), B<timespec>(3), "
624 "B<sem_overview>(7), B<time>(7)"
625 msgstr ""
626 "B<clock_gettime>(2), B<sem_getvalue>(3), B<sem_post>(3), B<timespec>(3), "
627 "B<sem_overview>(7), B<time>(7)"
628
629 #. type: TH
630 #: debian-trixie
631 #, no-wrap
632 msgid "2024-06-15"
633 msgstr "15 iunie 2024"
634
635 #. type: TH
636 #: debian-trixie
637 #, no-wrap
638 msgid "Linux man-pages 6.9.1"
639 msgstr "Pagini de manual de Linux 6.9.1"
640
641 #. type: Plain text
642 #: debian-trixie
643 msgid "POSIX threads library (I<libpthread>, I<-lpthread>)"
644 msgstr "Biblioteca de fire de execuție POSIX (I<libpthread>, I<-lpthread>)"
645
646 #. type: Plain text
647 #: debian-trixie fedora-44 fedora-rawhide
648 #, no-wrap
649 msgid ""
650 "#include E<lt>errno.hE<gt>\n"
651 "#include E<lt>semaphore.hE<gt>\n"
652 "#include E<lt>signal.hE<gt>\n"
653 "#include E<lt>stdio.hE<gt>\n"
654 "#include E<lt>stdlib.hE<gt>\n"
655 "#include E<lt>time.hE<gt>\n"
656 "#include E<lt>unistd.hE<gt>\n"
657 "\\&\n"
658 "#include E<lt>assert.hE<gt>\n"
659 "\\&\n"
660 "sem_t sem;\n"
661 "\\&\n"
662 "#define handle_error(msg) \\[rs]\n"
663 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
664 "\\&\n"
665 "static void\n"
666 "handler(int sig)\n"
667 "{\n"
668 " write(STDOUT_FILENO, \"sem_post() from handler\\[rs]n\", 24);\n"
669 " if (sem_post(&sem) == -1) {\n"
670 " write(STDERR_FILENO, \"sem_post() failed\\[rs]n\", 18);\n"
671 " _exit(EXIT_FAILURE);\n"
672 " }\n"
673 "}\n"
674 "\\&\n"
675 "int\n"
676 "main(int argc, char *argv[])\n"
677 "{\n"
678 " struct sigaction sa;\n"
679 " struct timespec ts;\n"
680 " int s;\n"
681 "\\&\n"
682 " if (argc != 3) {\n"
683 " fprintf(stderr, \"Usage: %s E<lt>alarm-secsE<gt> E<lt>wait-secsE<gt>\\[rs]n\",\n"
684 " argv[0]);\n"
685 " exit(EXIT_FAILURE);\n"
686 " }\n"
687 "\\&\n"
688 " if (sem_init(&sem, 0, 0) == -1)\n"
689 " handle_error(\"sem_init\");\n"
690 "\\&\n"
691 " /* Establish SIGALRM handler; set alarm timer using argv[1]. */\n"
692 "\\&\n"
693 " sa.sa_handler = handler;\n"
694 " sigemptyset(&sa.sa_mask);\n"
695 " sa.sa_flags = 0;\n"
696 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
697 " handle_error(\"sigaction\");\n"
698 "\\&\n"
699 " alarm(atoi(argv[1]));\n"
700 "\\&\n"
701 " /* Calculate relative interval as current time plus\n"
702 " number of seconds given argv[2]. */\n"
703 "\\&\n"
704 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
705 " handle_error(\"clock_gettime\");\n"
706 "\\&\n"
707 " ts.tv_sec += atoi(argv[2]);\n"
708 "\\&\n"
709 " printf(\"%s() about to call sem_timedwait()\\[rs]n\", __func__);\n"
710 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
711 " continue; /* Restart if interrupted by handler. */\n"
712 "\\&\n"
713 " /* Check what happened. */\n"
714 "\\&\n"
715 " if (s == -1) {\n"
716 " if (errno == ETIMEDOUT)\n"
717 " printf(\"sem_timedwait() timed out\\[rs]n\");\n"
718 " else\n"
719 " perror(\"sem_timedwait\");\n"
720 " } else\n"
721 " printf(\"sem_timedwait() succeeded\\[rs]n\");\n"
722 "\\&\n"
723 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
724 "}\n"
725 msgstr ""
726 "#include E<lt>errno.hE<gt>\n"
727 "#include E<lt>semaphore.hE<gt>\n"
728 "#include E<lt>signal.hE<gt>\n"
729 "#include E<lt>stdio.hE<gt>\n"
730 "#include E<lt>stdlib.hE<gt>\n"
731 "#include E<lt>time.hE<gt>\n"
732 "#include E<lt>unistd.hE<gt>\n"
733 "\\&\n"
734 "#include E<lt>assert.hE<gt>\n"
735 "\\&\n"
736 "sem_t sem;\n"
737 "\\&\n"
738 "#define handle_error(msg) \\[rs]\n"
739 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
740 "\\&\n"
741 "static void\n"
742 "handler(int sig)\n"
743 "{\n"
744 " write(STDOUT_FILENO, \"sem_post() de la gestionar\\[rs]n\", 24);\n"
745 " if (sem_post(&sem) == -1) {\n"
746 " write(STDERR_FILENO, \"sem_post() a eșuat\\[rs]n\", 18);\n"
747 " _exit(EXIT_FAILURE);\n"
748 " }\n"
749 "}\n"
750 "\\&\n"
751 "int\n"
752 "main(int argc, char *argv[])\n"
753 "{\n"
754 " struct sigaction sa;\n"
755 " struct timespec ts;\n"
756 " int s;\n"
757 "\\&\n"
758 " if (argc != 3) {\n"
759 " fprintf(stderr, \"Utilizare: %s E<lt>secunde-alarmăE<gt> E<lt>secunde-așteptareE<gt>\\[rs]n\",\n"
760 " argv[0]);\n"
761 " exit(EXIT_FAILURE);\n"
762 " }\n"
763 "\\&\n"
764 " if (sem_init(&sem, 0, 0) == -1)\n"
765 " handle_error(\"sem_init\");\n"
766 "\\&\n"
767 " /* Stabilește gestionarul SIGALRM; fixează temporizatorul de alarmă utilizând argv[1]. */\n"
768 "\\&\n"
769 " sa.sa_handler = handler;\n"
770 " sigemptyset(&sa.sa_mask);\n"
771 " sa.sa_flags = 0;\n"
772 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
773 " handle_error(\"sigaction\");\n"
774 "\\&\n"
775 " alarm(atoi(argv[1]));\n"
776 "\\&\n"
777 " /* Calculează intervalul relativ ca timp curent plus\n"
778 " numărul de secunde dat de argv[2]. */\n"
779 "\\&\n"
780 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
781 " handle_error(\"clock_gettime\");\n"
782 "\\&\n"
783 " ts.tv_sec += atoi(argv[2]);\n"
784 "\\&\n"
785 " printf(\"%s() pe cale să apeleze sem_timedwait()\\[rs]n\", __func__);\n"
786 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
787 " continue; /* Repornește dacă este întrerupt de gestionar. */\n"
788 "\\&\n"
789 " /* Verifică ce s-a întâmplat. */\n"
790 "\\&\n"
791 " if (s == -1) {\n"
792 " if (errno == ETIMEDOUT)\n"
793 " printf(\"sem_timedwait() timed out\\[rs]n\");\n"
794 " else\n"
795 " perror(\"sem_timedwait\");\n"
796 " } else\n"
797 " printf(\"sem_timedwait() a reușit\\[rs]n\");\n"
798 "\\&\n"
799 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
800 "}\n"
801
802 #. type: TH
803 #: fedora-44 fedora-rawhide
804 #, no-wrap
805 msgid "2024-07-23"
806 msgstr "23 iulie 2024"
807
808 #. type: TH
809 #: fedora-44 fedora-rawhide
810 #, no-wrap
811 msgid "Linux man-pages 6.13"
812 msgstr "Pagini de manual de Linux 6.13"
813
814 #. type: TH
815 #: mageia-cauldron
816 #, no-wrap
817 msgid "Linux man-pages 6.17"
818 msgstr "Pagini de manual de Linux 6.17"
819
820 #. type: TH
821 #: opensuse-leap-16-1 opensuse-tumbleweed
822 #, no-wrap
823 msgid "Linux man-pages (unreleased)"
824 msgstr "Pagini de manual Linux (nepublicate)"