Skip to content

event/kqueue: add EVFILT_MACHPORT - #1661

Open
utzcoz wants to merge 1 commit into
bytecodealliance:mainfrom
utzcoz:kqueue-machport
Open

event/kqueue: add EVFILT_MACHPORT#1661
utzcoz wants to merge 1 commit into
bytecodealliance:mainfrom
utzcoz:kqueue-machport

Conversation

@utzcoz

@utzcoz utzcoz commented Aug 13, 2026

Copy link
Copy Markdown

Mach ports are the only IPC on Apple platforms that can carry a port right, so anything built on them needs a way to wait on one. kqueue has EVFILT_MACHPORT for that, but there was no way to reach it from here.

Report readiness only, with no fflags: the filter can also dequeue a message into a buffer supplied through the kevent64 extension fields, which this API does not model. Waiting for a message and then receiving it is the common case and needs none of that.

The identifier is a mach_port_name_t rather than a file descriptor, so it gets a type of its own instead of reusing RawFd.

Mach ports are the only IPC on Apple platforms that can carry a port right, so
anything built on them needs a way to wait on one. kqueue has EVFILT_MACHPORT
for that, but there was no way to reach it from here.

Report readiness only, with no fflags: the filter can also dequeue a message
into a buffer supplied through the kevent64 extension fields, which this API
does not model. Waiting for a message and then receiving it is the common case
and needs none of that.

The identifier is a mach_port_name_t rather than a file descriptor, so it gets
a type of its own instead of reusing RawFd.
@utzcoz

utzcoz commented Aug 14, 2026

Copy link
Copy Markdown
Author

Looks like CI failures are not related this PR:

error: attributes starting with `rustc` are reserved for use by the `rustc` compiler
  --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.4/src/backend/linux_raw/io/errno.rs:49:25
   |
49 | #[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0xf001))]
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: attributes starting with `rustc` are reserved for use by the `rustc` compiler
  --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.4/src/backend/linux_raw/io/errno.rs:50:25
   |
50 | #[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_end(0xffff))]
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: cannot find attribute `rustc_layout_scalar_valid_range_start` in this scope
  --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.4/src/backend/linux_raw/io/errno.rs:49:25
   |
49 | #[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_start(0xf001))]
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: cannot find attribute `rustc_layout_scalar_valid_range_end` in this scope
  --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.4/src/backend/linux_raw/io/errno.rs:50:25
   |
50 | #[cfg_attr(rustc_attrs, rustc_layout_scalar_valid_range_end(0xffff))]
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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.

1 participant