| 29 | } |
| 30 | |
| 31 | static bool fiber_read(int fd, long long& out) |
| 32 | { |
| 33 | if (read_wait(fd, 2) <= 0) { |
| 34 | printf("read_wait error for fd=%d\r\n", fd); |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | long long n; |
| 39 | ssize_t ret = read(fd, &n, sizeof(n)); |
| 40 | if (ret != sizeof(n)) { |
| 41 | printf("read from eventfd %d error %s\r\n", |
| 42 | fd, acl::last_serror()); |
| 43 | return false; |
| 44 | } else { |
| 45 | out = n; |
| 46 | return true; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | #endif // __linux__ |
| 51 |
no test coverage detected
searching dependent graphs…