bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #48372] read with size 0 from fifo blocks


From: Kalle Olavi Niemitalo
Subject: [bug #48372] read with size 0 from fifo blocks
Date: Wed, 6 Jul 2016 16:04:24 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.8.0

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

[Prev in Thread] Current Thread [Next in Thread]