D_PRINTF(debugfile, "retryWrite(%d, %d)=%d\n", sock, count, byteswritten);
D_PRINTF(debugfile, "retryWrite(%d, ?)=%d\n", sock, byteswritten);
retryWrite(ptcx_t ptcx, SOCKET sock, char *buf, int count){    int ret;    int byteswritten = 0;    D_PRINTF(debugfile, "retryWrite(%d, %d)\n", sock, count);    while (count) {	if (gf_timeexpired >= EXIT_FAST) {	    D_PRINTF (debugfile, "retryWrite gf_timeexpired\n");	    strcpy (ptcx->errMsg, "read:timeout");	    break;	}	ret = NETWRITE(sock, buf, count);	if (ret < 0) {	    if (errno == EINTR)		continue;	    if (errno == EAGAIN) {		if (waitWriteable(sock)) {		    continue;		}	    }	    if (byteswritten == 0) {		byteswritten = -1;	    }	    sprintf (ptcx->errMsg,		     "retryWrite(sock=%d, n=%d) IO error", sock, count);	    break;	}		    	byteswritten += ret;	buf += ret;	count -= ret;    }    D_PRINTF(debugfile, "retryWrite(%d, %d)=%d\n", sock, count, byteswritten);    return byteswritten;}