Lines Matching refs:fd
71 int fd = urandom_fd_requested; in init_once() local
74 if (fd == -2) { in init_once()
76 fd = open("/dev/urandom", O_RDONLY); in init_once()
77 } while (fd == -1 && errno == EINTR); in init_once()
80 if (fd < 0) { in init_once()
84 int flags = fcntl(fd, F_GETFD); in init_once()
92 if (fcntl(fd, F_SETFD, flags) == -1) { in init_once()
96 urandom_fd = fd; in init_once()
101 void RAND_set_urandom_fd(int fd) { in RAND_set_urandom_fd() argument
102 fd = dup(fd); in RAND_set_urandom_fd()
103 if (fd < 0) { in RAND_set_urandom_fd()
108 urandom_fd_requested = fd; in RAND_set_urandom_fd()
112 if (urandom_fd != fd) { in RAND_set_urandom_fd()
117 void RAND_enable_fork_unsafe_buffering(int fd) { in RAND_enable_fork_unsafe_buffering() argument
118 if (fd >= 0) { in RAND_enable_fork_unsafe_buffering()
119 fd = dup(fd); in RAND_enable_fork_unsafe_buffering()
120 if (fd < 0) { in RAND_enable_fork_unsafe_buffering()
124 fd = -2; in RAND_enable_fork_unsafe_buffering()
129 urandom_fd_requested = fd; in RAND_enable_fork_unsafe_buffering()
133 if (urandom_buffering != 1 || (fd >= 0 && urandom_fd != fd)) { in RAND_enable_fork_unsafe_buffering()
161 static char read_full(int fd, uint8_t *out, size_t len) { in read_full() argument
166 r = read(fd, out, len); in read_full()