K 10 svn:author V 7 delphij K 8 svn:date V 27 2014-06-12T00:15:07.451830Z K 7 svn:log V 1006 Cumulative update to arc4random(3). MFC r227519, r227520, r238118, r241046: r227519 (das) Sync the style, comments, and variable names of arc4random.c with OpenBSD's version (r1.22). No functional changes, as verified with md5. r227520 (das) Further reduce diffs with OpenBSD's arc4random. The main functional change here is to ensure that when a process forks after arc4random is seeded, the parent and child don't observe the same random sequence. OpenBSD's fix introduces some additional overhead in the form of a getpid() call. The only significant remaining difference between our arc4random and OpenBSD's is in how we seed the generator in arc4_stir(). r238118 (pjd): Prefer sysctl to open/read/close for obtaining random data. This method is more sandbox-friendly and also should be faster as only one syscall is needed instead of three. In case of an error fall back to the old method. r241046 (jilles) libc: Use O_CLOEXEC for various internal file descriptors. Approved by: re (gjb) END