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


Ignore:
Timestamp:
2014-04-16T17:14:06Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f857e8b
Parents:
dba3e2c (diff), 70b570c (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 mainline changes

File:
1 edited

Legend:

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

    rdba3e2c r8b863a62  
    3535
    3636#define LIBPOSIX_INTERNAL
     37#define __POSIX_DEF__(x) posix_##x
    3738
    3839#include "internal/common.h"
     
    6263        // TODO: low priority, just a compile-time dependency of binutils
    6364        not_implemented();
     65        return 0;
    6466}
    6567
     
    231233        // TODO: low priority, just a compile-time dependency of binutils
    232234        not_implemented();
     235        return 0;
    233236}
    234237
     
    243246int posix_system(const char *string) {
    244247        // TODO: does nothing at the moment
     248        not_implemented();
    245249        return 0;
    246250}
     
    387391                free(ptr);
    388392        }
     393}
     394
     395/**
     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);
    389413}
    390414
Note: See TracChangeset for help on using the changeset viewer.