| 25 | static int warned; |
| 26 | |
| 27 | static void fdinfo_read(struct io_uring *ring) |
| 28 | { |
| 29 | char fd_name[128]; |
| 30 | char *buf; |
| 31 | int fd; |
| 32 | |
| 33 | buf = malloc(4096); |
| 34 | |
| 35 | sprintf(fd_name, "/proc/self/fdinfo/%d", ring->ring_fd); |
| 36 | fd = open(fd_name, O_RDONLY); |
| 37 | if (fd < 0) { |
| 38 | perror("open"); |
| 39 | return; |
| 40 | } |
| 41 | |
| 42 | do { |
| 43 | int ret = read(fd, buf, 4096); |
| 44 | |
| 45 | if (ret < 0) { |
| 46 | perror("fdinfo read"); |
| 47 | break; |
| 48 | } else if (ret == 4096) { |
| 49 | continue; |
| 50 | } |
| 51 | break; |
| 52 | } while (1); |
| 53 | |
| 54 | close(fd); |
| 55 | free(buf); |
| 56 | } |
| 57 | |
| 58 | static int __test_io(const char *file, struct io_uring *ring, int write, |
| 59 | int buffered, int sqthread, int fixed, int nonvec, |
no outgoing calls