+ pthread_mutex_lock(&send_lock);
+#if 1
+ for (i = total = 0; i < ntiov; i++)
+ total += tiov[i].iov_len;
+
+ sysrc = syscall(SYS_writev, c->fd, tiov, ntiov);
+ if (sysrc != total) {
+ fprintf (stderr, "BAD SEND rc %d != %d, errno %d\n",
+ rc, total, errno);
+ rc = PTL_FAIL;
+ }
+#else
+ for (i = total = 0; i <= ntiov; i++) {
+ rc = send(c->fd, tiov[i].iov_base, tiov[i].iov_len, 0);
+
+ if (rc != tiov[i].iov_len) {
+ fprintf (stderr, "BAD SEND rc %d != %d, errno %d\n",
+ rc, tiov[i].iov_len, errno);
+ rc = PTL_FAIL;
+ break;
+ }
+ total += rc;