* fhandler.h (fhandler_socket::read): Declare.

(fhandler_socket::write): Declare.
	* fhandler_procsys.cc (fhandler_procsys::read): Add FIXME comment.
	(fhandler_procsys::write): Ditto.
	* fhandler_socket.cc (fhandler_socket::read): New method.
	(fhandler_socket::write): New method.
	* syscalls.cc: Rearrange order of read/write functions.
	(read): Call fhandler read method directly instead of just readv.
	(readv): Remove EINTR loop.  This is done in all affected fhandler's
	now.
	(write): Call fhandler write method directly instead of just writev.
	Fix debug output.
This commit is contained in:
Corinna Vinschen
2011-05-06 10:56:37 +00:00
parent 92ddb74290
commit a4e5706eb2
5 changed files with 145 additions and 64 deletions

View File

@ -1316,6 +1316,14 @@ fhandler_socket::getpeername (struct sockaddr *name, int *namelen)
return res;
}
void __stdcall
fhandler_socket::read (void *in_ptr, size_t& len)
{
WSABUF wsabuf = { len, (char *) in_ptr };
WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
len = recv_internal (&wsamsg);
}
int
fhandler_socket::readv (const struct iovec *const iov, const int iovcnt,
ssize_t tot)
@ -1530,6 +1538,14 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags)
return ret;
}
int
fhandler_socket::write (const void *ptr, size_t len)
{
WSABUF wsabuf = { len, (char *) ptr };
WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
return send_internal (&wsamsg, 0);
}
int
fhandler_socket::writev (const struct iovec *const iov, const int iovcnt,
ssize_t tot)