Debian Codegraph @

templates/man3/rand.3.pot

raw
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:39+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "rand"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
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 "rand, rand_r, srand - pseudo-random number generator"
50 msgstr ""
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "LIBRARY"
57 msgstr ""
58
59 #. type: Plain text
60 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
61 #: opensuse-leap-16-1 opensuse-tumbleweed
62 msgid "Standard C library (I<libc>,\\ I<-lc>)"
63 msgstr ""
64
65 #. type: SH
66 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
67 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
68 #, no-wrap
69 msgid "SYNOPSIS"
70 msgstr ""
71
72 #. type: Plain text
73 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
74 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
75 #, no-wrap
76 msgid "B<#include E<lt>stdlib.hE<gt>>\n"
77 msgstr ""
78
79 #. type: Plain text
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid ""
84 "B<int rand(void);>\n"
85 "B<void srand(unsigned int >I<seed>B<);>\n"
86 msgstr ""
87
88 #. type: Plain text
89 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
90 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
91 #, no-wrap
92 msgid "B<[[deprecated]] int rand_r(unsigned int *>I<seedp>B<);>\n"
93 msgstr ""
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
102 #. type: Plain text
103 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
104 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
105 msgid "B<rand_r>():"
106 msgstr ""
107
108 #. type: Plain text
109 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
110 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
111 #, no-wrap
112 msgid ""
113 " Since glibc 2.24:\n"
114 " _POSIX_C_SOURCE E<gt>= 199506L\n"
115 " glibc 2.23 and earlier\n"
116 " _POSIX_C_SOURCE\n"
117 msgstr ""
118
119 #. type: SH
120 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
121 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
122 #, no-wrap
123 msgid "DESCRIPTION"
124 msgstr ""
125
126 #. type: Plain text
127 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
128 #: opensuse-tumbleweed
129 msgid ""
130 "The B<rand>() function returns a pseudo-random integer in the range 0 to "
131 "B<RAND_MAX> inclusive (i.e., the mathematical range [B<0>,\\ B<RAND_MAX>])."
132 msgstr ""
133
134 #. type: Plain text
135 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
136 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
137 msgid ""
138 "The B<srand>() function sets its argument as the seed for a new sequence of "
139 "pseudo-random integers to be returned by B<rand>(). These sequences are "
140 "repeatable by calling B<srand>() with the same seed value."
141 msgstr ""
142
143 #. type: Plain text
144 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
145 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
146 msgid ""
147 "If no seed value is provided, the B<rand>() function is automatically "
148 "seeded with a value of 1."
149 msgstr ""
150
151 #. type: Plain text
152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
154 msgid ""
155 "The function B<rand>() is not reentrant, since it uses hidden state that is "
156 "modified on each call. This might just be the seed value to be used by the "
157 "next call, or it might be something more elaborate. In order to get "
158 "reproducible behavior in a threaded application, this state must be made "
159 "explicit; this can be done using the reentrant function B<rand_r>()."
160 msgstr ""
161
162 #. type: Plain text
163 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
164 #: opensuse-tumbleweed
165 msgid ""
166 "Like B<rand>(), B<rand_r>() returns a pseudo-random integer in the range "
167 "[B<0>,\\ B<RAND_MAX>]. The I<seedp> argument is a pointer to an I<unsigned "
168 "int> that is used to store state between calls. If B<rand_r>() is called "
169 "with the same initial value for the integer pointed to by I<seedp>, and that "
170 "value is not modified between calls, then the same pseudo-random sequence "
171 "will result."
172 msgstr ""
173
174 #. type: Plain text
175 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
176 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
177 msgid ""
178 "The value pointed to by the I<seedp> argument of B<rand_r>() provides only "
179 "a very small amount of state, so this function will be a weak pseudo-random "
180 "generator. Try B<drand48_r>(3) instead."
181 msgstr ""
182
183 #. type: SH
184 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
185 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
186 #, no-wrap
187 msgid "RETURN VALUE"
188 msgstr ""
189
190 #. type: Plain text
191 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
192 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
193 msgid ""
194 "The B<rand>() and B<rand_r>() functions return a value between 0 and "
195 "B<RAND_MAX> (inclusive). The B<srand>() function returns no value."
196 msgstr ""
197
198 #. type: SH
199 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
200 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
201 #, no-wrap
202 msgid "ATTRIBUTES"
203 msgstr ""
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 "For an explanation of the terms used in this section, see B<attributes>(7)."
210 msgstr ""
211
212 #. type: tbl table
213 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
214 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
215 #, no-wrap
216 msgid "Interface"
217 msgstr ""
218
219 #. type: tbl table
220 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
221 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
222 #, no-wrap
223 msgid "Attribute"
224 msgstr ""
225
226 #. type: tbl table
227 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
228 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
229 #, no-wrap
230 msgid "Value"
231 msgstr ""
232
233 #. type: tbl table
234 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
235 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
236 #, no-wrap
237 msgid ".na\n"
238 msgstr ""
239
240 #. type: tbl table
241 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
242 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
243 #, no-wrap
244 msgid ".nh\n"
245 msgstr ""
246
247 #. type: tbl table
248 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
249 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
250 #, no-wrap
251 msgid ""
252 "B<rand>(),\n"
253 "B<rand_r>(),\n"
254 "B<srand>()"
255 msgstr ""
256
257 #. type: tbl table
258 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
259 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
260 #, no-wrap
261 msgid "Thread safety"
262 msgstr ""
263
264 #. type: tbl table
265 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
266 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
267 #, no-wrap
268 msgid "MT-Safe"
269 msgstr ""
270
271 #. type: SH
272 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
273 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
274 #, no-wrap
275 msgid "VERSIONS"
276 msgstr ""
277
278 #. type: Plain text
279 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
280 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
281 msgid ""
282 "The versions of B<rand>() and B<srand>() in the Linux C Library use the "
283 "same random number generator as B<random>(3) and B<srandom>(3), so the "
284 "lower-order bits should be as random as the higher-order bits. However, on "
285 "older B<rand>() implementations, and on current implementations on "
286 "different systems, the lower-order bits are much less random than the higher-"
287 "order bits. Do not use this function in applications intended to be "
288 "portable when good randomness is needed. (Use B<random>(3) instead.)"
289 msgstr ""
290
291 #. type: SH
292 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
293 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
294 #, no-wrap
295 msgid "STANDARDS"
296 msgstr ""
297
298 #. type: TP
299 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
300 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
301 #, no-wrap
302 msgid "B<rand>()"
303 msgstr ""
304
305 #. type: TQ
306 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
307 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
308 #, no-wrap
309 msgid "B<srand>()"
310 msgstr ""
311
312 #. type: Plain text
313 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
314 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
315 msgid "C11, POSIX.1-2008."
316 msgstr ""
317
318 #. type: TP
319 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
320 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
321 #, no-wrap
322 msgid "B<rand_r>()"
323 msgstr ""
324
325 #. type: Plain text
326 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
327 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
328 msgid "POSIX.1-2008."
329 msgstr ""
330
331 #. type: SH
332 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
333 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
334 #, no-wrap
335 msgid "HISTORY"
336 msgstr ""
337
338 #. type: Plain text
339 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
340 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
341 msgid "SVr4, 4.3BSD, C89, POSIX.1-2001."
342 msgstr ""
343
344 #. type: Plain text
345 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
346 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
347 msgid "POSIX.1-2001. Obsolete in POSIX.1-2008."
348 msgstr ""
349
350 #. type: SH
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 #, no-wrap
354 msgid "EXAMPLES"
355 msgstr ""
356
357 #. type: Plain text
358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
360 msgid ""
361 "POSIX.1-2001 gives the following example of an implementation of B<rand>() "
362 "and B<srand>(), possibly useful when one needs the same sequence on two "
363 "different machines."
364 msgstr ""
365
366 #. type: Plain text
367 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
368 #: opensuse-leap-16-1 opensuse-tumbleweed
369 #, no-wrap
370 msgid ""
371 "static unsigned long next = 1;\n"
372 "\\&\n"
373 "/* RAND_MAX assumed to be 32767 */\n"
374 "int myrand(void) {\n"
375 " next = next * 1103515245 + 12345;\n"
376 " return((unsigned) (next/65536) % 32768);\n"
377 "}\n"
378 "\\&\n"
379 "void mysrand(unsigned int seed) {\n"
380 " next = seed;\n"
381 "}\n"
382 msgstr ""
383
384 #. type: Plain text
385 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
386 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
387 msgid ""
388 "The following program can be used to display the pseudo-random sequence "
389 "produced by B<rand>() when given a particular seed. When the seed is "
390 "I<-1>, the program uses a random seed."
391 msgstr ""
392
393 #. type: Plain text
394 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
395 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
396 #, no-wrap
397 msgid ""
398 "#include E<lt>stdio.hE<gt>\n"
399 "#include E<lt>stdlib.hE<gt>\n"
400 "\\&\n"
401 "int\n"
402 "main(int argc, char *argv[])\n"
403 "{\n"
404 " int r;\n"
405 " unsigned int seed, nloops;\n"
406 "\\&\n"
407 " if (argc != 3) {\n"
408 " fprintf(stderr, \"Usage: %s E<lt>seedE<gt> E<lt>nloopsE<gt>\\[rs]n\", argv[0]);\n"
409 " exit(EXIT_FAILURE);\n"
410 " }\n"
411 "\\&\n"
412 " seed = atoi(argv[1]);\n"
413 " nloops = atoi(argv[2]);\n"
414 "\\&\n"
415 " if (seed == -1) {\n"
416 " seed = arc4random();\n"
417 " printf(\"seed: %u\\[rs]n\", seed);\n"
418 " }\n"
419 "\\&\n"
420 " srand(seed);\n"
421 " for (unsigned int j = 0; j E<lt> nloops; j++) {\n"
422 " r = rand();\n"
423 " printf(\"%d\\[rs]n\", r);\n"
424 " }\n"
425 "\\&\n"
426 " exit(EXIT_SUCCESS);\n"
427 "}\n"
428 msgstr ""
429
430 #. type: SH
431 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
432 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
433 #, no-wrap
434 msgid "SEE ALSO"
435 msgstr ""
436
437 #. type: Plain text
438 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
439 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
440 msgid "B<drand48>(3), B<random>(3)"
441 msgstr ""
442
443 #. type: TH
444 #: debian-trixie
445 #, no-wrap
446 msgid "2024-06-15"
447 msgstr ""
448
449 #. type: TH
450 #: debian-trixie
451 #, no-wrap
452 msgid "Linux man-pages 6.9.1"
453 msgstr ""
454
455 #. type: Plain text
456 #: debian-trixie
457 msgid "Standard C library (I<libc>, I<-lc>)"
458 msgstr ""
459
460 #. type: Plain text
461 #: debian-trixie fedora-44 fedora-rawhide
462 msgid ""
463 "The B<rand>() function returns a pseudo-random integer in the range 0 to "
464 "B<RAND_MAX> inclusive (i.e., the mathematical range [0,\\ B<RAND_MAX>])."
465 msgstr ""
466
467 #. type: Plain text
468 #: debian-trixie fedora-44 fedora-rawhide
469 msgid ""
470 "Like B<rand>(), B<rand_r>() returns a pseudo-random integer in the range "
471 "[0,\\ B<RAND_MAX>]. The I<seedp> argument is a pointer to an I<unsigned "
472 "int> that is used to store state between calls. If B<rand_r>() is called "
473 "with the same initial value for the integer pointed to by I<seedp>, and that "
474 "value is not modified between calls, then the same pseudo-random sequence "
475 "will result."
476 msgstr ""
477
478 #. type: Plain text
479 #: debian-trixie
480 #, no-wrap
481 msgid ""
482 "static unsigned long next = 1;\n"
483 "\\&\n"
484 "/* RAND_MAX assumed to be 32767 */\n"
485 "int myrand(void) {\n"
486 " next = next * 1103515245 + 12345;\n"
487 " return((unsigned)(next/65536) % 32768);\n"
488 "}\n"
489 "\\&\n"
490 "void mysrand(unsigned int seed) {\n"
491 " next = seed;\n"
492 "}\n"
493 msgstr ""
494
495 #. type: TH
496 #: fedora-44 fedora-rawhide
497 #, no-wrap
498 msgid "2025-01-05"
499 msgstr ""
500
501 #. type: TH
502 #: fedora-44 fedora-rawhide
503 #, no-wrap
504 msgid "Linux man-pages 6.13"
505 msgstr ""
506
507 #. type: TH
508 #: mageia-cauldron
509 #, no-wrap
510 msgid "Linux man-pages 6.17"
511 msgstr ""
512
513 #. type: TH
514 #: opensuse-leap-16-1 opensuse-tumbleweed
515 #, no-wrap
516 msgid "Linux man-pages (unreleased)"
517 msgstr ""