Function socket_protocol

Source
pub const unsafe fn socket_protocol<Device: IoDevice>(
    num: int,
) -> SocketProtocolFixed<Device>
Expand description

Builds a reasonable default implementation of SocketProtocol with a fixed protocol number and device type.

Safety: Caller must ensure that the specified device marker type is suitable for the type of socket the kernel will return when requesting this protocol. This works in conjunction with the safety rules for implementing ioctl requests on device types; the designated device should only have ioctl request constants that can be called against a file descriptor of this protocol without the risk of memory corruption caused by an incorrect argument type.