Follow-up Comment #4, bug #48372 (project hurd):

IEEE Std 1003.1, 2013 Edition makes nbyte==0 a special case in the read and
pread functions, but I don't see similar special cases in the recv, recvfrom,
and recvmsg functions.  AFAICT, those should consume the message from a
message-based socket even if the buffer has zero length, unless MSG_PEEK is
specified.

pflocal/io.c (S_io_read) calls pipe_read, which calls pipe_recv (pipe,
noblock, 0, source, data, data_len, amount, 0,0,0,0).

pflocal/socket.c (S_socket_recv) calls pipe_recv (..., control, control_len,
ports, num_ports).  In hurd/socket.defs (socket_recv), those correspond to
output parameters, so I believe they are not included in the request message
and the mig-generated code will ensure that e.g. control != NULL.

I think pipe_read should then apply the shortcut behavior only if (amount == 0
&& data_only).  That way, the change would not affect recv, recvfrom, and
recvmsg.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48372>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


Reply via email to