9#ifndef DO_NOT_USE_GET_ENTROPY
10static int ensure_pool_initialized_getentropy()
13 return getentropy(&tmp, sizeof(tmp));
18// Poll /dev/random to wait for randomness. This is a proxy for the /dev/urandom
19// pool being initialized.
20static int ensure_pool_initialized_poll()
23 int dev_random = open("/dev/random", O_RDONLY);
32 int ret = poll(&pfd, 1, -1);
33 if (ret < 0 && (errno == EAGAIN || errno == EINTR))
44 return close(dev_random);
47// Returns 0 on success, non-zero on failure.
48int ensure_pool_initialized()
51#ifndef DO_NOT_USE_GET_ENTROPY
52 if (ensure_pool_initialized_getentropy() == 0)
57 return ensure_pool_initialized_poll();
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list