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


Ignore:
Timestamp:
2013-09-29T06:56:33Z (12 years ago)
Author:
Beniamino Galvani <b.galvani@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9bd960d
Parents:
3deb0155 (diff), 13be2583 (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

    r3deb0155 rdd0c8a0  
    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 1;
    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.