[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /dev/random for FreeBSD [was: Re: /dev/random for Linux]

Blocking vs. non-blocking is a standard issue in design of U*X devices.
Standard solution: make it block by default, and accept an IOCTL to put it in
non-blocking mode.  There's even a POSIX way to do this:

	flags_or_err = fcntl(fd, F_GETFL, 0);
	{check for error}
	res = fcntl(fd, F_SETFL, flags_or_err | O_NONBLOCK);
	{check for error}