Macro nix::cmsg_space

source ·
macro_rules! cmsg_space {
    ( $( $x:ty ),* ) => { ... };
}
Available on crate features socket and uio only.
Expand description

Create a buffer large enough for storing some control messages as returned by recvmsg.

Examples

// Create a buffer for a `ControlMessageOwned::ScmTimestamp` message
let _ = cmsg_space!(TimeVal);
// Create a buffer big enough for a `ControlMessageOwned::ScmRights` message
// with two file descriptors
let _ = cmsg_space!([RawFd; 2]);
// Create a buffer big enough for a `ControlMessageOwned::ScmRights` message
// and a `ControlMessageOwned::ScmTimestamp` message
let _ = cmsg_space!(RawFd, TimeVal);