-
Notifications
You must be signed in to change notification settings - Fork 55
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
WIP: Fix OpenBSD support #216
base: develop
Are you sure you want to change the base?
Conversation
This was based on upstream Any clue as to how/when this was changing, and is this PR backwards-compatible "enough"? |
It looks like this changed in 2021 openbsd/xenocara@9d1e1e2 OpenBSD only supports the last two releases, with one release every 6 months that means we don't need to worry (besides, breaking API and ABI across releases is not a huge issue in OpenBSD land). |
Latest push includes a few fixes based on feedback from @MarijnS95. I also added a check to handle the actual error case "??" properly. I am not convinced that |
We can't really mark a function as thread-unsafe in rust, so I am afraid this would need a global lock variable. |
OpenBSD uses the same names as Linux and FreeBSD since OpenBSD 6.9, see https://cvsweb.openbsd.org/xenocara/lib/libdrm/xf86drm.h?rev=1.27
required for libc::devname
Clarified the |
This makes OpenBSD work properly on my machine.
WIP because it depends on a libc change in rust-lang/libc#4285 (comment)
My rust experience is rather limited so I'm looking forward to hear how this could be improved.
One potential problem I see is that
devname()
is not thread-safe as is because the name buffer is static. Does this need to be copied safely, guarded by a lock or marked unsafe?