Changes in / [736b07b:3dd148d] in mainline
- Location:
- uspace/lib/posix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/stdlib.h
r736b07b r3dd148d 46 46 #define NULL ((void *) 0) 47 47 #endif 48 49 #define RAND_MAX 71402550 48 51 49 /* Process Termination */ … … 124 122 extern int __POSIX_DEF__(mkstemp)(char *tmpl); 125 123 126 /* Pseudo-random number generator */127 extern int __POSIX_DEF__(rand)(void);128 extern void __POSIX_DEF__(srand)(unsigned int seed);129 130 124 /* Legacy Declarations */ 131 125 extern char *__POSIX_DEF__(mktemp)(char *tmpl); -
uspace/lib/posix/source/stdlib.c
r736b07b r3dd148d 394 394 395 395 /** 396 * Generate a pseudo random integer in the range 0 to RAND_MAX inclusive.397 *398 * @return The pseudo random integer.399 */400 int posix_rand(void)401 {402 return (int) random();403 }404 405 /**406 * Initialize a new sequence of pseudo-random integers.407 *408 * @param seed The seed of the new sequence.409 */410 void posix_srand(unsigned int seed)411 {412 srandom(seed);413 }414 415 /**416 396 * Creates and opens an unique temporary file from template. 417 397 *
Note:
See TracChangeset
for help on using the changeset viewer.