-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Incorrect CMSG functions on BSD #1210
Labels
C-bug
Category: bug
Comments
asomers
added a commit
to asomers/libc
that referenced
this issue
Jan 15, 2019
PR rust-lang#1098 added the CMSG_DATA(3) family of functions into libc. Because they're defined as macros in C, they had to be rewritten as Rust functions for libc. Also, they can't be tested in CI for the same reason. But that PR erroneously used the same definitions in BSD as in Linux. This commit corrects the definitions for OSX, FreeBSD, DragonflyBSD, OpenBSD, and NetBSD. I renamed a few variables and collapsed a few macros in order to combine the definitions where possible. Fixes rust-lang#1210
asomers
added a commit
to asomers/libc
that referenced
this issue
Jan 16, 2019
PR rust-lang#1098 added the CMSG_DATA(3) family of functions into libc. Because they're defined as macros in C, they had to be rewritten as Rust functions for libc. Also, they can't be tested in CI for the same reason. But that PR erroneously used the same definitions in BSD as in Linux. This commit corrects the definitions for OSX, FreeBSD, DragonflyBSD, OpenBSD, and NetBSD. I renamed a few variables and collapsed a few macros in order to combine the definitions where possible. Fixes rust-lang#1210
bors
added a commit
that referenced
this issue
Jan 17, 2019
Fix CMSG_DATA(3) and friends on BSD PR #1098 added the CMSG_DATA(3) family of functions into libc. Because they're defined as macros in C, they had to be rewritten as Rust functions for libc. Also, they can't be tested in CI for the same reason. But that PR erroneously used the same definitions in BSD as in Linux. This commit corrects the definitions for OSX, FreeBSD, DragonflyBSD, OpenBSD, and NetBSD. I renamed a few variables and collapsed a few macros in order to combine the definitions where possible. Fixes #1210
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PR #1098 introduced Rust functions that duplicate the
CMSG_FIRSTHDR
,CMSG_NXTHDR
,CMSG_DATA
,CMSG_SPACE
, andCMSG_LEN
C macros. However, several of these are incorrect on BSD. It looks like the author wrote the Linux versions first, and then simply copied them into src/unix/bsd/mod.rs. For example, on both FreeBSD and OpenBSDCMSG_DATA
is defined aseven though the actual C macro is
The text was updated successfully, but these errors were encountered: