2 * UCW Library -- Cryptographically Safe Random Key Generator
4 * (c) 2002 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
16 randomkey(byte *buf, uns size)
20 if ((fd = open("/dev/urandom", O_RDONLY, 0)) < 0)
21 die("Unable to open /dev/urandom: %m");
22 if (read(fd, buf, size) != (int) size)
23 die("Error reading /dev/urandom: %m");