Added timer to insure I/O operations are fast enough for bit-bang

This commit is contained in:
Bill Cox
2014-11-08 10:35:48 -05:00
parent 74a41705fb
commit 5951fd00dd
2 changed files with 30 additions and 7 deletions

View File

@@ -67,12 +67,12 @@ void inmWaitForPoolToHaveRoom(void) {
fd: inmDevRandomFD,
events: POLLOUT,
};
int64_t timeout_usec;
int64_t timeout_msec;
if (ioctl(inmDevRandomFD, RNDGETENTCNT, &ent_count) == 0 && ent_count < inmFillWatermark) {
return;
}
timeout_usec = 1000; // One second
poll(&pfd, 1, timeout_usec);
timeout_msec = 1000; // One second
poll(&pfd, 1, timeout_msec);
}
// Add the bytes to the entropy pool. This can be unwhitenened, but the estimated bits of