Changeset 9ea8664 in rtems-libbsd for freebsd/sys/sys/random.h


Ignore:
Timestamp:
Jun 26, 2018, 11:54:08 AM (16 months ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, 4a77611a223ea883fb548679b516d326a020d447
Children:
879eaa7
Parents:
9efc650
git-author:
Christian Mauderer <christian.mauderer@…> (06/26/18 11:54:08)
git-committer:
Christian Mauderer <christian.mauderer@…> (08/01/18 07:55:27)
Message:

random: Implement read_random via getentropy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sys/sys/random.h

    r9efc650 r9ea8664  
    5151        return (0);
    5252}
     53#ifndef __rtems__
    5354static __inline u_int
    5455read_random(void *a __unused, u_int b __unused)
     
    5657        return (0);
    5758}
     59#else /* __rtems__ */
     60#include <unistd.h>
     61static __inline u_int
     62read_random(void *ptr, u_int n)
     63{
     64        getentropy(ptr, n);
     65        return (n);
     66}
     67#endif /* __rtems__ */
    5868#endif
    5969
Note: See TracChangeset for help on using the changeset viewer.