-
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
Move kqueue-related definitions from nix to libc #379
Conversation
Add definitions for struct kqueue, function kqueue, and for all related #defines for every BSD-derived operating system.
Reported by: Sebastien Marie
(rust_highfive has picked a reviewer for you, use r? to override) |
I fixed the macos test failures. The FreeBSD tests failed because your CI VM is too old. It's complaining about symbols that are defined in FreeBSD 11 but not in FreeBSD 10. And I don't know why the OpenBSD test failed. Could somebody please take a look at it? |
The macos tests are still failing because OSX is a moving target. The value of EVFILT_SYSCOUNT has changed twice recently. What do you want to do about that? Should we omit it from the bindings? It's not a very useful definition. |
nchanges: ::size_t, | ||
eventlist: *mut ::kevent, | ||
nevents: ::size_t, | ||
timeout: *const ::timespec) -> ::c_int; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nchanges
and nevents
should be c_int
.
But I am unsure about the error message of OpenBSD test: it seems related to return type ?
Awesome, thanks! Could perhaps some of the more unstable or up-to-date constants be left out for now? Or do they all need to be added all at once? |
I can leave out some of the newer constants. I think I should leave out EVFILT_SYSCOUNT too, because that changes from one release to another. It strikes me that rather than use FFI, a C module might be more appropriate for these definitions. It would be able to automatically detect which constants are defined and set their values correctly. I know how to write such a module for Ruby, but not for Rust. Is there a way to define publicly visible Rust symbols from C code? |
For the libc crate itself we wouldn't have any C code, but for something like nix that could work! You can call C from Rust easily with just a |
* Rollback FreeBSD definitions to circa 10.3-RELEASE * Remove EVFILT_SYSCOUNT across the board. It's value is changeable, so it's not safe to define with FFI.
@bors: r+ Thanks! Also feel free to ping a PR whenever it's updated :) |
📌 Commit 38c4b8b has been approved by |
Move kqueue-related definitions from nix to libc This PR moves, as much as possible, kqueue and kevent related definitions from the nix crate to libc. There will be a companion PR to the nix repo.
☀️ Test successful - status-appveyor, travis |
Move kqueue-related definitions from nix to libc See rust-lang/libc#379 for the companion commit to libc. If and when that commit is merged, I'll update nix's Cargo.toml file and add it to this PR.
Add missing wait flag WUNTRACED for non-Linux systems My understanding is that this flag is required by POSIX, so all systems should allow for it
The final version of libc's PR rust-lang#379 removed a few definitions, and fixed OpenBSD's definition of fn kevent.
* split the portable vector tests into separate crates * use rustc reductions
This PR moves, as much as possible, kqueue and kevent related definitions from the nix crate to libc. There will be a companion PR to the nix repo.