aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2021-04-15 11:21:14 -0400
committerKen Brown <kbrown@cornell.edu>2021-04-15 11:21:14 -0400
commitc5c7cec44917283d983b8b35bbf11c43fbca7710 (patch)
tree2aacdca8eb6497edc2c69c0e9730376f824b6487
parent82c65349c2592207ba9fec15d869962858713a5c (diff)
downloadnewlib-topic/af_unix.zip
newlib-topic/af_unix.tar.gz
newlib-topic/af_unix.tar.bz2
Cygwin: AF_UNIX: select: DGRAM sockets are always ready for writinggithub/topic/af_unixtopic/af_unix
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.
-rw-r--r--winsup/cygwin/select.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 9d3d86d..3594abd 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -2077,12 +2077,17 @@ check_write:
gotone += me->write_ready = true;
goto out;
}
- /* FIXME: With our current implementation of datagram sockets,
- we have no send buffer, so we can't adequately test whether a
- write would block. We might block waiting for a pipe
- connection. */
- if (fh->get_socket_type () == SOCK_STREAM
- && fh->connect_state () == connected)
+ if (fh->get_socket_type () == SOCK_DGRAM)
+ /* We have no send buffer to check for available space, so
+ just report ready for write. 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. */
+ {
+ 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
test for space available in the buffer doesn't make sense