From 3787b37ef2c8a86a1c67ccef6dde3df568ed5ae9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 20 Jan 2009 11:16:59 +0000 Subject: * autoload.cc (WSAIoctl): Reintroduce. (WSASendMsg): Define. * fhandler.h (class fhandler_socket): Change definition of recv_internal and send_internal to take WSAMSG pointer as parameter. * fhandler_socket.cc (WSAID_WSARECVMSG): Define. (LPFN_WSARECVMSG): Define. (WSASendMsg): Declare. (get_ext_funcptr): New function to fetch address of WSARecvMsg. (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter. Change code accordingly. If control information is requested, fetch address of WSARecvMsg and use that instead of WSARecvFrom. (fhandler_socket::recvfrom): Change return type to ssize_t as declared in fhandler.h. Accommodate changes to recv_internal. (fhandler_socket::recvmsg): Ditto. Make sure that control information is only requested if system, address family, and socket type support it. (fhandler_socket::send_internal): Take just a LPWSAMSG parameter and the flags. Change code accordingly. If control information is provided, use WSASendMsg instead of WSASendTo. (fhandler_socket::sendto): Drop useless comment. Accommodate changes to send_internal. (fhandler_socket::sendmsg): Ditto. Make sure that control information is only provided if system, address family, and socket type support it. * wincap.h (wincaps::has_recvmsg): New element. (wincaps::has_sendmsg): New element * wincap.cc: Implement above elements throughout. * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment of type struct cmsghdr. --- winsup/cygwin/fhandler.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index c98a7d533..9d7cbd9f3 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -483,16 +483,13 @@ class fhandler_socket: public fhandler_base int open (int flags, mode_t mode = 0); ssize_t readv (const struct iovec *, int iovcnt, ssize_t tot = -1); - inline ssize_t recv_internal (struct _WSABUF *wsabuf, DWORD wsacnt, - DWORD flags, - struct sockaddr *from, int *fromlen); + inline ssize_t recv_internal (struct _WSAMSG *wsamsg); ssize_t recvfrom (void *ptr, size_t len, int flags, struct sockaddr *from, int *fromlen); ssize_t recvmsg (struct msghdr *msg, int flags); ssize_t writev (const struct iovec *, int iovcnt, ssize_t tot = -1); - inline ssize_t send_internal (struct _WSABUF *wsabuf, DWORD wsacnt, int flags, - const struct sockaddr *to, int tolen); + inline ssize_t send_internal (struct _WSAMSG *wsamsg, int flags); ssize_t sendto (const void *ptr, size_t len, int flags, const struct sockaddr *to, int tolen); ssize_t sendmsg (const struct msghdr *msg, int flags); -- cgit v1.2.3