MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / etdoio

Function etdoio

net/kernel_socket.cpp:886–901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884
885template<typename IOCB, typename WAITCB>
886static __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
903class ETKernelSocketStream : public KernelSocketStream, public NotifyContext {
904public:

Callers 6

do_sendMethod · 0.85
do_sendmsgMethod · 0.85
do_recvMethod · 0.85
do_recvmsgMethod · 0.85
do_sendfileMethod · 0.85
do_acceptMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected