recvfrom / sendto patch

Conrad Scott Conrad.Scott@dsl.pipex.com
Sun Aug 11 06:23:00 GMT 2002


Again, moving slowly towards my readv/writev patch, here's a
little patch to simplify the fhandler_socket sendto / recvfrom
code.

SUSv3 says that recvfrom, recv, and read are all equivalent on
sockets if no flags or addresses etc. are provided (and ditto for
sendto, send, and write).  So, this patch makes that true, partly
by removing some methods and making others just delegate to each
other as appropriate.  In detail:

*) I missed a couple of buflen == 0 checks in "net.cc" from my
last patch.

*) I've removed fhandler_socket recv and send methods and made the
cygwin_recv/send functions delegate to the cygwin_recvfrom/sendto
functions, with relevant default extra arguments.

*) The fhandler_socket read and write methods also delegate now to
recvfrom and sendto (rather than to recv and send as previously).

*) In all of this I discovered that fhandler_socket::sendto
couldn't handle a NULL address: patched too.

Enjoy!

// Conrad

p.s. This saves 1.5K on the DLL size!  Happy happy, joy joy!

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ChangeLog.txt
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020811/e8171ecf/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: recvsend.patch.txt
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020811/e8171ecf/attachment-0001.txt>


More information about the Cygwin-patches mailing list