1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 A program that reads /dev/random to produce a seed for srand(3).
15 main(int argc
, char *argv
[])
19 fd
= open("/dev/random", O_RDONLY
);
21 perror("/dev/random");
25 ok
= read(fd
, &seed
, sizeof seed
);
29 perror("/dev/random");