Changeset d856110 in mainline for uspace/lib/posix/source/stdlib.c


Ignore:
Timestamp:
2013-07-29T14:27:57Z (11 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
736b07b, b886b60, bdae198, ed29fe4
Parents:
bf963b9
Message:

add rand() and srand() to the posix library.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/source/stdlib.c

    rbf963b9 rd856110  
    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.