Lines Matching refs:tcp_nssock
735 if (statp->tcp_nssock >= 0 && (statp->flags & RES_F_VC) != 0) { in send_vc()
740 if (getpeername(statp->tcp_nssock, (struct sockaddr*)(void*)&peer, &size) < 0 || in send_vc()
742 getsockopt(statp->tcp_nssock, SOL_SOCKET, SO_MARK, &old_mark, &mark_size) < 0 || in send_vc()
748 if (statp->tcp_nssock < 0 || (statp->flags & RES_F_VC) == 0) { in send_vc()
749 if (statp->tcp_nssock >= 0) statp->closeSockets(); in send_vc()
751 statp->tcp_nssock.reset(socket(nsap->sa_family, SOCK_STREAM | SOCK_CLOEXEC, 0)); in send_vc()
752 if (statp->tcp_nssock < 0) { in send_vc()
766 resolv_tag_socket(statp->tcp_nssock, uid, statp->pid); in send_vc()
768 if (setsockopt(statp->tcp_nssock, SOL_SOCKET, SO_MARK, &statp->mark, in send_vc()
776 if (random_bind(statp->tcp_nssock, nsap->sa_family) < 0) { in send_vc()
782 if (connect_with_timeout(statp->tcp_nssock, nsap, (socklen_t)nsaplen, in send_vc()
810 if (writev(statp->tcp_nssock, iov, 2) != static_cast<ptrdiff_t>(INT16SZ + msg.size())) { in send_vc()
822 while ((n = read(statp->tcp_nssock, (char*)cp, (size_t)len)) > 0) { in send_vc()
862 while (len != 0 && (n = read(statp->tcp_nssock, (char*)cp, (size_t)len)) > 0) { in send_vc()
882 n = read(statp->tcp_nssock, junk, (len > sizeof junk) ? sizeof junk : len); in send_vc()