Russ Coxa934846f21 years agoHistory
17 lines · 306 B · C
RawDownload
#include <u.h>#include <libc.h> ulongtruerand(void){	ulong x;	static int randfd = -1; 	if(randfd < 0)		randfd = open("/dev/random", OREAD|OCEXEC);	if(randfd < 0)		sysfatal("can't open /dev/random");	if(read(randfd, &x, sizeof(x)) != sizeof(x))		sysfatal("can't read /dev/random");	return x;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t