summaryrefslogtreecommitdiffstats
path: root/src/io-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/io-unix.c')
-rw-r--r--src/io-unix.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/src/io-unix.c b/src/io-unix.c
index 8ed8e42..ea65a76 100644
--- a/src/io-unix.c
+++ b/src/io-unix.c
@@ -90,8 +90,7 @@ int tf_close(struct tf_fd *fd)
return 0;
}
-int tf_read_fully(struct tf_fd *fd, void *buf, size_t count,
- tf_mtime_diff_t timeout)
+int tf_read_fully(struct tf_fd *fd, void *buf, size_t count)
{
ssize_t n;
int r;
@@ -120,16 +119,14 @@ int tf_read_fully(struct tf_fd *fd, void *buf, size_t count,
continue;
}
- r = tf_schedule(timeout);
- timeout = TF_NO_TIMEOUT_CHANGE;
+ r = tf_schedule();
} while (r == TF_WAKEUP_FD);
tf_fd_unmonitor(fd);
return -r;
}
-int tf_write_fully(struct tf_fd *fd, const void *buf, size_t count,
- tf_mtime_diff_t timeout)
+int tf_write_fully(struct tf_fd *fd, const void *buf, size_t count)
{
ssize_t n;
int r;
@@ -155,15 +152,14 @@ int tf_write_fully(struct tf_fd *fd, const void *buf, size_t count,
continue;
}
- r = tf_schedule(timeout);
- timeout = TF_NO_TIMEOUT_CHANGE;
+ r = tf_schedule();
} while (r == TF_WAKEUP_FD);
tf_fd_unmonitor(fd);
return -r;
}
-ssize_t tf_read(struct tf_fd *fd, void *buf, size_t count, tf_mtime_diff_t timeout)
+ssize_t tf_read(struct tf_fd *fd, void *buf, size_t count)
{
ssize_t n;
@@ -178,16 +174,14 @@ ssize_t tf_read(struct tf_fd *fd, void *buf, size_t count, tf_mtime_diff_t timeo
n = -errno;
break;
}
- n = tf_schedule(timeout);
- timeout = TF_NO_TIMEOUT_CHANGE;
+ n = tf_schedule();
} while (n == TF_WAKEUP_FD);
tf_fd_unmonitor(fd);
return n;
}
-ssize_t tf_write(struct tf_fd *fd, const void *buf, size_t count,
- tf_mtime_diff_t timeout)
+ssize_t tf_write(struct tf_fd *fd, const void *buf, size_t count)
{
ssize_t n;
@@ -202,8 +196,7 @@ ssize_t tf_write(struct tf_fd *fd, const void *buf, size_t count,
n = -errno;
break;
}
- n = tf_schedule(timeout);
- timeout = TF_NO_TIMEOUT_CHANGE;
+ n = tf_schedule();
} while (n == TF_WAKEUP_FD);
tf_fd_unmonitor(fd);
@@ -250,7 +243,7 @@ int tf_listen(struct tf_fd *fd, int backlog)
}
int tf_accept(struct tf_fd *listen_fd, struct tf_fd *child_fd,
- struct tf_sockaddr *from, tf_mtime_diff_t timeout)
+ struct tf_sockaddr *from)
{
int r, tfdf;
struct sockaddr *addr = NULL;
@@ -277,8 +270,7 @@ int tf_accept(struct tf_fd *listen_fd, struct tf_fd *child_fd,
tf_fd_unmonitor(listen_fd);
return -errno;
}
- r = tf_schedule(timeout);
- timeout = TF_NO_TIMEOUT_CHANGE;
+ r = tf_schedule();
} while (r == TF_WAKEUP_FD);
tf_fd_unmonitor(listen_fd);
if (r < 0)
@@ -287,8 +279,7 @@ int tf_accept(struct tf_fd *listen_fd, struct tf_fd *child_fd,
return tf_open_fd(child_fd, r, tfdf);
}
-int tf_connect(struct tf_fd *fd, const struct tf_sockaddr *to,
- tf_mtime_diff_t timeout)
+int tf_connect(struct tf_fd *fd, const struct tf_sockaddr *to)
{
socklen_t l = sizeof(int);
int r, err;
@@ -302,7 +293,7 @@ int tf_connect(struct tf_fd *fd, const struct tf_sockaddr *to,
/* Wait for socket to become readable */
tf_fd_monitor(fd, EPOLLOUT);
- r = tf_schedule(timeout);
+ r = tf_schedule();
tf_fd_unmonitor(fd);
if (r != TF_WAKEUP_FD)
return r;
@@ -316,8 +307,7 @@ int tf_connect(struct tf_fd *fd, const struct tf_sockaddr *to,
ssize_t tf_recvmsg(struct tf_fd *fd,
struct tf_sockaddr *from,
struct tf_sockaddr *to,
- void *buf, size_t len,
- tf_mtime_diff_t timeout)
+ void *buf, size_t len)
{
struct iovec iov;
struct msghdr msg;
@@ -347,8 +337,7 @@ ssize_t tf_recvmsg(struct tf_fd *fd,
r = -errno;
break;
}
- r = tf_schedule(timeout);
- timeout = TF_NO_TIMEOUT_CHANGE;
+ r = tf_schedule();
} while (r == TF_WAKEUP_FD);
tf_fd_unmonitor(fd);
@@ -372,8 +361,7 @@ ssize_t tf_recvmsg(struct tf_fd *fd,
ssize_t tf_sendmsg(struct tf_fd *fd,
struct tf_sockaddr *from,
const struct tf_sockaddr *to,
- const void *buf, size_t len,
- tf_mtime_diff_t timeout)
+ const void *buf, size_t len)
{
struct msghdr msg;
struct iovec iov;
@@ -412,8 +400,7 @@ ssize_t tf_sendmsg(struct tf_fd *fd,
r = -errno;
break;
}
- r = tf_schedule(timeout);
- timeout = TF_NO_TIMEOUT_CHANGE;
+ r = tf_schedule();
} while (r == TF_WAKEUP_FD);
tf_fd_unmonitor(fd);