Changeset 736b07b in mainline


Ignore:
Timestamp:
2013-07-29T15:17:21Z (11 years ago)
Author:
Manuele Conti <conti.ma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
38eb0d7, 6b6f394d
Parents:
3dd148d (diff), d856110 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline changes.

Location:
uspace/lib/posix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/stdlib.h

    r3dd148d r736b07b  
    4646        #define NULL  ((void *) 0)
    4747#endif
     48
     49#define RAND_MAX  714025
    4850
    4951/* Process Termination */
     
    122124extern int __POSIX_DEF__(mkstemp)(char *tmpl);
    123125
     126/* Pseudo-random number generator */
     127extern int __POSIX_DEF__(rand)(void);
     128extern void __POSIX_DEF__(srand)(unsigned int seed);
     129
    124130/* Legacy Declarations */
    125131extern char *__POSIX_DEF__(mktemp)(char *tmpl);
  • uspace/lib/posix/source/stdlib.c

    r3dd148d r736b07b  
    394394
    395395/**
     396 * Generate a pseudo random integer in the range 0 to RAND_MAX inclusive.
     397 *
     398 * @return The pseudo random integer.
     399 */
     400int 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 */
     410void posix_srand(unsigned int seed)
     411{
     412        srandom(seed);
     413}
     414
     415/**
    396416 * Creates and opens an unique temporary file from template.
    397417 *
Note: See TracChangeset for help on using the changeset viewer.