Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMSG_SPACE should be const #2087

Closed
kalcutter opened this issue Feb 28, 2021 · 0 comments · Fixed by #2132
Closed

CMSG_SPACE should be const #2087

kalcutter opened this issue Feb 28, 2021 · 0 comments · Fixed by #2132
Labels
C-API-request Category: API request

Comments

@kalcutter
Copy link

It would be useful to be able to do something like this:

const CONTROL_LEN: usize = libc::CMSG_SPACE(mem::size_of::<RawFd>() as _) as _;

This is possible in C/C++.

@kalcutter kalcutter added the C-API-request Category: API request label Feb 28, 2021
bors added a commit that referenced this issue Mar 30, 2021
Constify `CMSG_SPACE` for all the targets

`CMSG_SPACE` is a const fn for Linux but it isn't for other targets. This constifies it on all the targets for consistency.

Fixes #2087
@bors bors closed this as completed in f2e7721 Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API-request Category: API request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant