@@ -72,14 +72,51 @@ bitflags!(
72
72
// Flags for send/recv and their relatives
73
73
libc_bitflags ! {
74
74
pub flags MsgFlags : libc:: c_int {
75
+ /// Sends or requests out-of-band data on sockets that support this notion
76
+ /// (e.g., of type [`Stream`](enum.SockType.html)); the underlying protocol must also
77
+ /// support out-of-band data.
75
78
MSG_OOB ,
79
+ /// Peeks at an incoming message. The data is treated as unread and the next
80
+ /// [`recv()`](fn.recv.html)
81
+ /// or similar function shall still return this data.
76
82
MSG_PEEK ,
83
+ /// Enables nonblocking operation; if the operation would block,
84
+ /// `EAGAIN` or `EWOULDBLOCK` is returned. This provides similar
85
+ /// behavior to setting the `O_NONBLOCK` flag
86
+ /// (via the [`fcntl`](../../fcntl/fn.fcntl.html)
87
+ /// `F_SETFL` operation), but differs in that `MSG_DONTWAIT` is a per-
88
+ /// call option, whereas `O_NONBLOCK` is a setting on the open file
89
+ /// description (see [open(2)](http://man7.org/linux/man-pages/man2/open.2.html)),
90
+ /// which will affect all threads in
91
+ /// the calling process and as well as other processes that hold
92
+ /// file descriptors referring to the same open file description.
77
93
MSG_DONTWAIT ,
94
+ /// Receive flags: Control Data was discarded (buffer too small)
78
95
MSG_CTRUNC ,
96
+ /// For raw ([`Packet`](addr/enum.AddressFamily.html)), Internet datagram
97
+ /// (since Linux 2.4.27/2.6.8),
98
+ /// netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4)
99
+ /// sockets: return the real length of the packet or datagram, even
100
+ /// when it was longer than the passed buffer. Not implemented for UNIX
101
+ /// domain ([unix(7)](https://linux.die.net/man/7/unix)) sockets.
102
+ ///
103
+ /// For use with Internet stream sockets, see [tcp(7)](https://linux.die.net/man/7/tcp).
79
104
MSG_TRUNC ,
105
+ /// Terminates a record (when this notion is supported, as for
106
+ /// sockets of type [`SeqPacket`](enum.SockType.html)).
80
107
MSG_EOR ,
108
+ /// This flag specifies that queued errors should be received from
109
+ /// the socket error queue. (For more details, see
110
+ /// [recvfrom(2)](https://linux.die.net/man/2/recvfrom))
81
111
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
82
112
MSG_ERRQUEUE ,
113
+ /// Set the `close-on-exec` flag for the file descriptor received via a UNIX domain
114
+ /// file descriptor using the `SCM_RIGHTS` operation (described in
115
+ /// [unix(7)](https://linux.die.net/man/7/unix)).
116
+ /// This flag is useful for the same reasons as the `O_CLOEXEC` flag of
117
+ /// [open(2)](https://linux.die.net/man/2/open).
118
+ ///
119
+ /// Only used in [`recvmsg`](fn.recvmsg.html) function.
83
120
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
84
121
MSG_CMSG_CLOEXEC ,
85
122
}
0 commit comments