nix
nix copied to clipboard
could not find `ucontext` in `nix` for aarch64-linux-android
error[E0433]: failed to resolve: could not find ucontext
in nix
--> src\main.rs:22:39
|
22 | if let Ok(context) = nix::ucontext::UContext::get() {
| ^^^^^^^^ could not find ucontext
in nix
nix = { version = "0.28.0", features = ["signal","ucontext"] }
Yeah, it is currently exclusive to Linux, we can add it for Android if the required libc types and constants are available
@yujack008 are you sure that setcontext and getcontext are implemented on Android? My googling suggests that they are not. https://android.googlesource.com/platform/bionic/+/c124baa/libc/arch-arm/include/machine/ucontext.h https://groups.google.com/g/android-ndk/c/rbrQGZxuUSM?pli=1 https://lwn.net/Articles/496359/
Yeah, it seems that they are not implemented on Android.
$ cd bionic
$ rg "setcontext"
$ rg "getcontext"
$
So there's nothing we can do.