Skip to content

event: add kevent64 support on apple targets#2781

Merged
SteveLauC merged 3 commits into
nix-rust:masterfrom
kamalmarhubi:kevent64
May 11, 2026
Merged

event: add kevent64 support on apple targets#2781
SteveLauC merged 3 commits into
nix-rust:masterfrom
kamalmarhubi:kevent64

Conversation

@kamalmarhubi

@kamalmarhubi kamalmarhubi commented Apr 22, 2026

Copy link
Copy Markdown
Member

Add KEvent64, Kevent64Flags, and Kqueue::kevent64 wrapping the kevent64 syscall available on apple platforms. This uses fixed-width 64-bit fields and provides an additional ext field for filter-specific data.

What does this PR do

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@kamalmarhubi

kamalmarhubi commented Apr 22, 2026

Copy link
Copy Markdown
Member Author

Draft while waiting for rust-lang/libc#5070

@kamalmarhubi kamalmarhubi force-pushed the kevent64 branch 2 times, most recently from 144aa17 to aca6408 Compare April 25, 2026 02:37
@kamalmarhubi kamalmarhubi marked this pull request as ready for review April 25, 2026 02:37
@kamalmarhubi

Copy link
Copy Markdown
Member Author

New constants are in 0.2.186

Comment thread src/sys/event.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an Apple-specific kevent64(2) wrapper to nix::sys::event, exposing a fixed-width 64-bit event structure and flags to support the extra ext data supported by the Darwin syscall.

Changes:

  • Add KEvent64 (wrapper around libc::kevent64_s) with constructors and field accessors on apple_targets.
  • Add Kqueue::kevent64 and Kevent64Flags to call libc::kevent64 on Apple platforms.
  • Add an Apple-only unit test validating KEvent64 accessors/layout and a changelog entry; bump libc dependency.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/sys/event.rs Introduces KEvent64, Kqueue::kevent64, and Kevent64Flags under cfg(apple_targets).
test/sys/test_event.rs Adds an Apple-only test validating KEvent64 getters and size_of vs libc::kevent64_s.
changelog/2781.added.md Documents the newly added kevent64 API surface on Apple targets.
Cargo.toml Bumps libc to a newer patch version to support the new Darwin types/syscall.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sys/event.rs
Comment thread src/sys/event.rs

@SteveLauC SteveLauC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let me handle the follow-up work:

  1. Rename the type
  2. Add a macOS-specific unit test for kqueue.kevent64()

so that I can merge this PR today.

Add KEvent64, Kevent64Flags, and Kqueue::kevent64 wrapping the
kevent64 syscall available on apple platforms. This uses fixed-width
64-bit fields and provides an additional ext field for filter-specific
data.
@SteveLauC SteveLauC enabled auto-merge May 11, 2026 05:18
@SteveLauC SteveLauC added this pull request to the merge queue May 11, 2026
Merged via the queue into nix-rust:master with commit 3407489 May 11, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants