Ignore:
File:
1 edited

Legend:

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

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