Skip to content

recvmsg should take &mut [u8] instead of &mut Vec<u8> for cmsg_buffer #2523

Closed
@erenon

Description

@erenon

Currently, recvmsg takes a mut cmsg_buffer: Option<&'a mut Vec<u8>> argument. This potentially forces the caller to allocate a right-sized Vec (or keep one around), though recvmsg implementation immediately produces a slice of the vector, and never uses it as a vector.

What's the reason for having Vec on the interface? Could we have a &mut [u8] instead? That'd allow the called to put the buffer onto the stack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions