Be sure to call the function to achieve the dual circulation

#define wrap_call(dtype, x) \
    do { \
        dtype result; \
        do { \
            result = x; \
        } while ((result == -1) && (errno == EINTR)); \
        return result; \
    } while (0)

int accept_noeintr(int socket, struct sockaddr *restrict address,socklen_t *restrict address_len)
{
    wrap_call(int, accept(socket, address, address_len));
}

  

Guess you like

Origin www.cnblogs.com/hshy/p/11359907.html