Commit Graph
2 Commits
Author SHA1 Message Date
Alice Ryhl 268eaa8ab4 rust: poll: add __rust_helper to helpers
This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl <[email protected]>
Link: https://patch.msgid.link/[email protected]
Reviewed-by: Gary Guo <[email protected]>
Reviewed-by: Boqun Feng <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
2025-12-15 14:13:04 +01:00
Alice Ryhl de747bd023 poll: rust: allow poll_table ptrs to be null
It's possible for a poll_table to be null. This can happen if an
end-user just wants to know if a resource has events right now without
registering a waiter for when events become available. Furthermore,
these null pointers should be handled transparently by the API, so we
should not change `from_ptr` to return an `Option`. Thus, change
`PollTable` to wrap a raw pointer rather than use a reference so that
you can pass null.

Comments mentioning `struct poll_table` are changed to just `poll_table`
since `poll_table` is a typedef. (It's a typedef because it's supposed
to be opaque.)

Reviewed-by: Benno Lossin <[email protected]>
Signed-off-by: Alice Ryhl <[email protected]>
2025-07-14 14:12:24 +02:00