def sys_getrandom(self, buf, size, flags):
GRND_NONBLOCK = <NUM_LIT><EOL>GRND_RANDOM = <NUM_LIT><EOL>if size == <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>if buf not in self.current.memory:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>return -errno.EFAULT<EOL><DEDENT>if flags & ~(GRND_NONBLOCK | GRND_RANDOM):<EOL><INDENT>return -errno.EINVAL<EOL><DEDENT>self.current.write_bytes(buf, '<STR_LIT:\x00>' * size)<EOL>return size<EOL>
The getrandom system call fills the buffer with random bytes of buflen.
The source of random (/dev/random or /dev/urandom) is decided based on
the flags value.

Manticore's implementation simply fills a buffer with zeroes -- choosing
determinism over true randomness.

:param buf: address of buffer to be filled with random bytes
:param size: number of random bytes
:param flags: source of random (/dev/random or /dev/urandom)
:return: number of bytes copied to buf