From 3ffbd40b9cb238948409f5fe258a56cd3feac175 Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Tue, 4 Jun 2019 18:10:21 +0200 Subject: socket: expose MSG_WAITALL in MsgFlags MSG_WAITALL can be useful with recv() to wait the full amount of data requested. Signed-off-by: Stefano Garzarella --- src/sys/socket/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sys/socket') diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 0ba28358..a8631f24 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -132,6 +132,10 @@ libc_bitflags!{ /// [`recv()`](fn.recv.html) /// or similar function shall still return this data. MSG_PEEK; + /// Receive operation blocks until the full amount of data can be + /// returned. The function may return smaller amount of data if a signal + /// is caught, an error or disconnect occurs. + MSG_WAITALL; /// Enables nonblocking operation; if the operation would block, /// `EAGAIN` or `EWOULDBLOCK` is returned. This provides similar /// behavior to setting the `O_NONBLOCK` flag -- cgit v1.2.3