Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-09-04 13:39:35 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-09-04 13:39:35 +0400
commit4d147a03bdf2bdbec4e95f9f8a870568a9b8d007 (patch)
treedcc52161031f5bd070cef02e5f0c62779594f418 /winsup/cygwin/net.cc
parent3573883f9d79e5e3b745894d5c04da456449502b (diff)
* fhandler.h (fhandler_socket::read): Remove method.
(fhandler_socket::write): Ditto. (fhandler_socket::readv): New method. (fhandler_socket::writev): Ditto. (fhandler_socket::recvmsg): Add new optional argument. (fhandler_socket::sendmsg): Ditto. * fhandler.cc (fhandler_socket::read): Remove method. (fhandler_socket::write): Ditto. (fhandler_socket::readv): New method. (fhandler_socket::writev): Ditto. (fhandler_socket::recvmsg): Use win32's scatter/gather IO where possible. (fhandler_socket::sendmsg): Ditto. * net.cc (cygwin_recvmsg): Check the msghdr's iovec fields. (cygwin_sendmsg): Ditto. Add omitted sigframe.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index aa52a3cd5..7733d6e78 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -2112,7 +2112,11 @@ cygwin_recvmsg (int fd, struct msghdr *msg, int flags)
|| !fh)
res = -1;
else
- res = fh->recvmsg (msg, flags);
+ {
+ res = check_iovec_for_read (msg->msg_iov, msg->msg_iovlen);
+ if (res > 0)
+ res = fh->recvmsg (msg, flags, res); // res == iovec tot
+ }
syscall_printf ("%d = recvmsg (%d, %p, %x)", res, fd, msg, flags);
return res;
@@ -2123,6 +2127,8 @@ extern "C" int
cygwin_sendmsg (int fd, const struct msghdr *msg, int flags)
{
int res;
+ sigframe thisframe (mainthread);
+
fhandler_socket *fh = get (fd);
if (__check_invalid_read_ptr_errno (msg, sizeof msg)
@@ -2131,8 +2137,12 @@ cygwin_sendmsg (int fd, const struct msghdr *msg, int flags)
(unsigned) msg->msg_namelen))
|| !fh)
res = -1;
- else
- res = fh->sendmsg (msg, flags);
+ else
+ {
+ res = check_iovec_for_write (msg->msg_iov, msg->msg_iovlen);
+ if (res > 0)
+ res = fh->sendmsg (msg, flags, res); // res == iovec tot
+ }
syscall_printf ("%d = sendmsg (%d, %p, %x)", res, fd, msg, flags);
return res;