MCPcopy Create free account
hub / github.com/esnet/iperf / Nwrite

Function Nwrite

src/net.c:648–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646 */
647
648int
649Nwrite(int fd, const char *buf, size_t count, int prot)
650{
651 register ssize_t r;
652 register size_t nleft = count;
653
654 while (nleft > 0) {
655 r = write(fd, buf, nleft);
656 if (r < 0) {
657 switch (errno) {
658 case EINTR:
659 case EAGAIN:
660#if (EAGAIN != EWOULDBLOCK)
661 /* XXX EWOULDBLOCK can't happen without non-blocking sockets */
662 case EWOULDBLOCK:
663#endif
664 if (count == nleft)
665 return NET_SOFTERROR;
666 return count - nleft;
667
668 case ENOBUFS :
669 return NET_SOFTERROR;
670
671 default:
672 return NET_HARDERROR;
673 }
674 } else if (r == 0)
675 return NET_SOFTERROR;
676 nleft -= r;
677 buf += r;
678 }
679 return count;
680}
681
682#ifdef HAVE_UDP_SEGMENT
683static void udp_msg_gso(struct cmsghdr *cm, uint16_t gso_size)

Callers 15

iperf_tcp_sendFunction · 0.85
iperf_tcp_acceptFunction · 0.85
iperf_tcp_connectFunction · 0.85
iperf_set_send_stateFunction · 0.85
JSON_writeFunction · 0.85
iperf_got_sigendFunction · 0.85
iperf_connectFunction · 0.85
iperf_sctp_sendFunction · 0.85
iperf_sctp_acceptFunction · 0.85
iperf_sctp_connectFunction · 0.85
iperf_acceptFunction · 0.85
server_timer_procFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…