Lines Matching refs:fd
151 int fd = zend_atomic_int_load_ex(&random_fd); in php_random_bytes_ex()
154 if (fd < 0) { in php_random_bytes_ex()
156 fd = open("/dev/urandom", O_RDONLY); in php_random_bytes_ex()
157 if (fd < 0) { in php_random_bytes_ex()
168 if (fstat(fd, &st) != 0 || in php_random_bytes_ex()
175 close(fd); in php_random_bytes_ex()
184 if (!zend_atomic_int_compare_exchange_ex(&random_fd, &expected, fd)) { in php_random_bytes_ex()
185 close(fd); in php_random_bytes_ex()
187 fd = expected; in php_random_bytes_ex()
194 ssize_t n = read(fd, bytes + read_bytes, size - read_bytes); in php_random_bytes_ex()
270 int fd = zend_atomic_int_exchange(&random_fd, -1); in php_random_csprng_shutdown() local
271 if (fd != -1) { in php_random_csprng_shutdown()
272 close(fd); in php_random_csprng_shutdown()