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

Migrate all FFI declarations to libc #748

Closed
7 of 8 tasks
Susurrus opened this issue Aug 26, 2017 · 1 comment · Fixed by #648
Closed
7 of 8 tasks

Migrate all FFI declarations to libc #748

Susurrus opened this issue Aug 26, 2017 · 1 comment · Fixed by #648
Assignees
Milestone

Comments

@Susurrus
Copy link
Contributor

Susurrus commented Aug 26, 2017

We should remove all FFI declarations within nix in favor of types defined in the libc crate. Much of this work has already been done recently, but there's still some left. And since we don't let any new PRs be merged until libc support has been added, we can resolve this problem relatively easily.

Left to address:

@Susurrus
Copy link
Contributor Author

Susurrus commented Sep 3, 2017

We're currently looking really good for this. The big stopper now is the rest of the FFI types for socket, otherwise I think we're all done.

@Susurrus Susurrus added this to the 1.0 milestone Nov 15, 2017
bors bot added a commit that referenced this issue Dec 20, 2017
648:  Fix `struct msghdr` types on non-Linux platforms. r=Susurrus a=kinetiknz

Type `struct msghdr` and `struct cmsghdr` types defined in `sys/socket/ffi.rs` match the Linux headers, but differ from the standard header (and other OSes): http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html

This PR fixes a memory corruption/unsafety issue on non-Linux machines when using `recvmsg` with certain parameters.

While fixing this, I wondered what the reason was for nix not using libc's definition of these structures.

Closes #748.
@bors bors bot closed this as completed in #648 Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant