Skip to content
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

Switch to OwnedFd #3

Merged
merged 3 commits into from
Nov 29, 2022
Merged

Switch to OwnedFd #3

merged 3 commits into from
Nov 29, 2022

Conversation

mripard
Copy link
Owner

@mripard mripard commented Nov 29, 2022

No description provided.

Rust 1.63 improved the handling of file descriptors by including the new
OwnedFd and BorrowedFd structures.

This clarifies the semantics of the file descriptors we can return, and
most importantly around who has to close the file descriptor.

We also had that ambiguity, where depending on the structure
implementing the FromRawFd trait the caller was using, we would require
or not the caller to explicitly close the file descriptor we returned.

This essentially meant that we would expect the caller responsible of
closing the FD we allocated, which is what OwnedFd is about. Make it
clear and unambiguous by switching to an OwnedFd.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
It seems to be confused by the DmaBufHeapType structure and requires to
use Self as the enum name, even though it doesn't make much sense.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
@mripard mripard merged commit c7493a2 into master Nov 29, 2022
@mripard mripard deleted the ownedfd branch November 29, 2022 09:12
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