2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2015 Joyent, Inc.
17 * Regression test for illumos#5843.
22 #include <sys/random.h>
34 (void) memset(buf
, 'a', sizeof (buf
));
37 * Try to go ahead and corrupt ourselves NTRIES times.
39 for (i
= 0; i
< NTRIES
; i
++) {
40 (void) getrandom(buf
+ NOFF
, NBYTES
, 0);
43 for (i
= 0; i
< NOFF
; i
++) {
48 for (i
= NBYTES
+ NOFF
; i
< sizeof (buf
); i
++) {