summary refs log tree commit diff
path: root/devices
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-06-13 08:11:34 +0000
committerAlyssa Ross <hi@alyssa.is>2020-06-15 08:33:04 +0000
commit89059ee485b2eefdecc1e55daa14bcb857e6d2f1 (patch)
tree5d5f3d836c0439d9dbab5c828848c84deced67b5 /devices
parenteca4902ece142985f3fb2a16651d15d6dbf9b24b (diff)
downloadcrosvm-89059ee485b2eefdecc1e55daa14bcb857e6d2f1.tar
crosvm-89059ee485b2eefdecc1e55daa14bcb857e6d2f1.tar.gz
crosvm-89059ee485b2eefdecc1e55daa14bcb857e6d2f1.tar.bz2
crosvm-89059ee485b2eefdecc1e55daa14bcb857e6d2f1.tar.lz
crosvm-89059ee485b2eefdecc1e55daa14bcb857e6d2f1.tar.xz
crosvm-89059ee485b2eefdecc1e55daa14bcb857e6d2f1.tar.zst
crosvm-89059ee485b2eefdecc1e55daa14bcb857e6d2f1.zip
msg_socket: introduce UnixSeqpacketExt
Occasionally, it is useful to be able to use UnixSeqpacket as a type
that can represent any kind of MsgSocket.  For example, to keep some
MsgSockets of different types in a Vec.  In this case, it may be known
what type of messages should be sent over a socket, even though that
may not be represantable in the type system.

To accomodate this situation, this patch introduces send_msg_on_socket
and recv_msg_on_socket methods on UnixSeqpacket, that can be used to
send or receive any kind of MsgOnSocket.  The caller is obviously
responsible for ensuring that the messages being sent are of the type
expected by the socket.

This lack of type safety for message types is not ideal, and so
MsgSender and MsgReceiver should still be preferred wherever possible.

Message-Id: <20200614114344.22642-2-hi@alyssa.is>
Notes
Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
Diffstat (limited to 'devices')
0 files changed, 0 insertions, 0 deletions