Lines Matching refs:fd
407 int fd; member
435 int shm_id, fd, r; in wait_random_seeded() local
463 if ((fd = open(DEVRANDOM_WAIT, O_RDONLY)) != -1) { in wait_random_seeded()
464 if (DEVRANDM_WAIT_USE_SELECT && fd < FD_SETSIZE) { in wait_random_seeded()
466 FD_SET(fd, &fds); in wait_random_seeded()
467 while ((r = select(fd + 1, &fds, NULL, NULL, NULL)) < 0 in wait_random_seeded()
470 while ((r = read(fd, &c, 1)) < 0 && errno == EINTR); in wait_random_seeded()
472 close(fd); in wait_random_seeded()
512 return rd->fd != -1 in check_random_device()
513 && fstat(rd->fd, &st) != -1 in check_random_device()
530 return rd->fd; in get_random_device()
533 if ((rd->fd = open(random_device_paths[n], O_RDONLY)) == -1) in get_random_device()
534 return rd->fd; in get_random_device()
537 if (fstat(rd->fd, &st) != -1) { in get_random_device()
543 close(rd->fd); in get_random_device()
544 rd->fd = -1; in get_random_device()
547 return rd->fd; in get_random_device()
558 close(rd->fd); in close_random_device()
559 rd->fd = -1; in close_random_device()
567 random_devices[i].fd = -1; in ossl_rand_pool_init()
669 const int fd = get_random_device(i); in ossl_pool_acquire_entropy()
671 if (fd == -1) in ossl_pool_acquire_entropy()
676 bytes = read(fd, buffer, bytes_needed); in ossl_pool_acquire_entropy()