-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add netbsd's syscall.h. #2760
Add netbsd's syscall.h. #2760
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon. Please see the contribution instructions for more information. |
31e3e52
to
058b7c7
Compare
I don't know if these are stable, or how to find out if we can rely on these constants. |
I think asking on one of the NetBSD mailing lists might1 be appropriate. Perhaps Footnotes
|
from cvs syscall.h history, the values seems relatively stable (in sense they doesn't change). but beware that it isn't the same stability than Linux: values could be removed if the syscall gone. if you need some of them (because no libc wrapper), just adding the minimum required constants should be safe. else, you could lead to problems regarding the stability provided by rust libc crate (no symbols removed) versus the stability provided by the target (where symbols could be removed between major OS version). |
Hm, I wonder if it's better to just put it inside the stdlib, where it's not exposed publicly and would just be used for the internal implementation... we'd have to fix it if it were removed, but it wouldn't break anybody downstream. (Well... sort of. I guess it would mean if it were removed, code using older libstd would stop working, hm...) |
Yeah maybe. In that case we should only merge #2762 and keep |
Boost seems to use the syscall (and syscall.h) directly, so it's fine to add these definitions to libc. @bors r+ |
📌 Commit f08e26c has been approved by |
Add netbsd's syscall.h. This adds https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/syscall.h (I only need `SYS___futex`, but I added the rest as well.)
@Amanieu but does Boost why refuse to remove them if NetBSD do a breaking change ? |
The syscalls are part of the public headers so I guess you would just be expected to rebuild boost with the updated headers. |
Boost also uses __ulock functions for macOS, even though they are unstable (and will get you rejected from app stores: boostorg/atomic#55 for that reason). So I don't know if boost using something is indicative of its stability. Or at least, it is not indicative that we can use them. |
💔 Test failed - checks-actions |
@Amanieu for me, the problem is if all of these defines are commited in rust libc, it means that problems will arrived when NetBSD will remove one of them: rust libc stability will not permit to remove them. Please note that importing only |
In that case I'll just close this for now, we can just hard-code the sycall number in the standard library. |
This adds https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/syscall.h
(I only need
SYS___futex
, but I added the rest as well.)