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-02-08 14:54:10 +0300
committerCorinna Vinschen <corinna@vinschen.de>2002-02-08 14:54:10 +0300
commitfae28904e9bc81e39a14ff0bd3a35c955ba67001 (patch)
tree3f9f016ce356cb48bd0be5ecc7eb10a3652e68ed /winsup/cygwin/fhandler_socket.cc
parent9f25eed9c96cb37ee58fcb65aafb44f9c6183dde (diff)
* dtable.cc (dtable::dup2): Store fd for fhandler_socket.
* fhandler.h (fhandler_base::set_fd): New virtual method. (fhandler_base::get_fd): Ditto. (fhandler_socket::set_fd): Ditto. (fhandler_socket::get_fd): Ditto. * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead of native Winsock recv. (fhandler_socket::write): Call cygwin_send instead of native Winsock send. * net.cc (fdsock): Store fd in fhandler_socket.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index b62a203bf..33e9b39f3 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -251,27 +251,35 @@ fhandler_socket::fstat (struct stat *buf, path_conv *pc)
return fh.fstat (buf, pc);
}
+extern "C" int cygwin_recv (int, void *, int, unsigned int);
+
int __stdcall
fhandler_socket::read (void *ptr, size_t len)
{
sigframe thisframe (mainthread);
- int res = recv (get_socket (), (char *) ptr, len, 0);
+ int res = cygwin_recv (get_fd (), (char *) ptr, len, 0);
+#if 0
if (res == SOCKET_ERROR)
set_winsock_errno ();
+#endif
return res;
}
+extern "C" int cygwin_send (int, const void *, int, unsigned int);
+
int
fhandler_socket::write (const void *ptr, size_t len)
{
sigframe thisframe (mainthread);
- int res = send (get_socket (), (const char *) ptr, len, 0);
+ int res = cygwin_send (get_fd (), (const char *) ptr, len, 0);
+#if 0
if (res == SOCKET_ERROR)
{
set_winsock_errno ();
if (get_errno () == ECONNABORTED || get_errno () == ECONNRESET)
_raise (SIGPIPE);
}
+#endif
return res;
}