AF_UNIX shutdown

Ken Brown kbrown@cornell.edu
Fri Oct 16 14:16:05 GMT 2020


On 10/16/2020 8:55 AM, Ken Brown via Cygwin-developers wrote:
> Hi Corinna,
> 
> I'm about to add some code to handle shutdown info, and I want to make sure that 
> I understand how this is supposed to work.  fhandler_socket_unix::shutdown 
> contains the following comment:
> 
> /* Send shutdown info to peer.  Note that it's not necessarily fatal
>     if the info isn't sent here.  The info will be reproduced by any
>     followup package sent to the peer. */
> 
> Does that mean that sendmsg should send its shutdown state as part of every 
> packet it sends?
> 
> And I guess recvmsg should call grab_admin_pkg at every opportunity and should 
> also check the shutdown state in every regular packet it reads?

Another question:

sendmsg currently returns ESHUTDOWN if the socket has been shut down.  Shouldn't 
this be EPIPE? See https://man7.org/linux/man-pages/man2/sendmsg.2.html.

Ken


More information about the Cygwin-developers mailing list