Cygwin: AF_UNIX: select: DGRAM sockets are always ready for writing

Our DGRAM sockets have no send buffer to check for available space, so
we always report that they are ready for writing.  An attempt to send
might still block waiting for a pipe connection, but that's allowable
in view of the non-atomicity of select/send.
This commit is contained in:
Ken Brown 2021-04-15 11:21:14 -04:00
parent 82c65349c2
commit c5c7cec449
1 changed files with 11 additions and 6 deletions

View File

@ -2077,12 +2077,17 @@ check_write:
gotone += me->write_ready = true; gotone += me->write_ready = true;
goto out; goto out;
} }
/* FIXME: With our current implementation of datagram sockets, if (fh->get_socket_type () == SOCK_DGRAM)
we have no send buffer, so we can't adequately test whether a /* We have no send buffer to check for available space, so
write would block. We might block waiting for a pipe just report ready for write. An attempt to send might
connection. */ still block waiting for a pipe connection, but that's
if (fh->get_socket_type () == SOCK_STREAM allowable in view of the non-atomicity of select/send. */
&& fh->connect_state () == connected) {
select_printf ("DGRAM, so ready for write");
gotone += me->write_ready = true;
goto out;
}
else if (fh->connect_state () == connected)
{ {
/* FIXME: I'm not calling pipe_data_available because its /* FIXME: I'm not calling pipe_data_available because its
test for space available in the buffer doesn't make sense test for space available in the buffer doesn't make sense