双重循环实现函数确保调用

时光总嘲笑我的痴心妄想 提交于 2019-11-27 10:37:27
#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));
}

  

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!