FreeBSD/sys/dev/random/ivy.c
/* It is required that buf length is a multiple of sizeof(u_long). */
It is required that buf length is a multiple of sizeof(u_long).
It is required that buf length is a multiple of sizeof ( u_long ) .
static u_int
random_ivy_read(void *buf, u_int c)
{
	u_long *b, rndval;
	u_int count;
	KASSERT(c % sizeof(*b) == 0, ("partial read %d", c));
	b = buf;
	for (count = c; count > 0; count -= sizeof(*b)) {
		if (ivy_rng_store(&rndval) == 0)
			break;
		*b++ = rndval;
	}
	return (c - count);
}
static u_int random_ivy_read ( void * buf , u_int c ) { u_long * b , rndval ; u_int count ; KASSERT ( c % sizeof ( * b ) == 0 , ( " " , c ) ) ; b = buf ; for ( count = c ; count > 0 ; count -= sizeof ( * b ) ) { if ( ivy_rng_store ( & rndval ) == 0 ) break ; * b ++ = rndval ; } return ( c - count ) ; }
It is required that buf length is a multiple of sizeof(u_long).
It is required that buf length is a multiple of sizeof ( u_long ) .