-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
cmsg_space!
usable in const contexts. (#889)
Make `cmsg_space!` usable in const contexts, so that it can be used as a buffer size argument, and add a version of tests/net/unix.rs that uses stack-allocated buffers instead of `Vec`s. This exposes an alignment sublety, that buffers must be aligned to the needed alignment of `cmsghdr`; handle this by auto-aligning the provided buffer to the needed boundary.
- Loading branch information
1 parent
dd5dc44
commit ff9c7fb
Showing
4 changed files
with
691 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ mod poll; | |
mod sockopt; | ||
#[cfg(unix)] | ||
mod unix; | ||
#[cfg(unix)] | ||
mod unix_alloc; | ||
mod v4; | ||
mod v6; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.