| 884 | |
| 885 | template<typename IOCB, typename WAITCB> |
| 886 | static __FORCE_INLINE__ ssize_t etdoio(IOCB iocb, WAITCB waitcb) { |
| 887 | while (true) { |
| 888 | ssize_t ret = iocb(); |
| 889 | if (ret < 0) { |
| 890 | auto e = errno; // errno is usually a macro that expands to a function call |
| 891 | if (e == EINTR) continue; |
| 892 | if (e == EAGAIN || e == EWOULDBLOCK || e == EINPROGRESS) { |
| 893 | if (waitcb()) // non-zero result means timeout or |
| 894 | // interrupt, need to return |
| 895 | return ret; |
| 896 | continue; |
| 897 | } |
| 898 | } |
| 899 | return ret; |
| 900 | } |
| 901 | } |
| 902 | |
| 903 | class ETKernelSocketStream : public KernelSocketStream, public NotifyContext { |
| 904 | public: |
no outgoing calls
no test coverage detected