Opened 15 months ago

Last modified 15 months ago

#18548 closed bug

recv(2) with AF_UNIX blocks upon empty receive buffer; MSG_DONTWAIT ignored — at Version 1

Reported by: kohlschuetter Owned by: axeld
Priority: critical Milestone: R1/beta5
Component: Network & Internet/UDP Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by korli)

When receiving datagrams via AF_UNIX, a buffer-empty condition prevents "recv" from returning immediately with an error when MSG_DONTWAIT is set.

This prevents code relying on these features from working as expected.

A workaround is to define a receive timeout on the socket, however that may be brittle when receiving an existing socket via file descriptors, for example.

Related to #18539

Change History (2)

by kohlschuetter, 15 months ago

Attachment: recvtest.c added

Example code demonstrating the bug

comment:1 by korli, 15 months ago

Description: modified (diff)
Summary: recv(2) with AF_UNIX blocks upon empty receive buffer; MSG_NOWAIT ignoredrecv(2) with AF_UNIX blocks upon empty receive buffer; MSG_DONTWAIT ignored
Note: See TracTickets for help on using tickets.