nix icon indicating copy to clipboard operation
nix copied to clipboard

could not find `ucontext` in `nix` for aarch64-linux-android

Open yujack008 opened this issue 10 months ago • 1 comments

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"] }

yujack008 avatar Apr 11 '24 08:04 yujack008

Yeah, it is currently exclusive to Linux, we can add it for Android if the required libc types and constants are available

SteveLauC avatar Apr 11 '24 08:04 SteveLauC

@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/

asomers avatar May 16 '24 02:05 asomers

Yeah, it seems that they are not implemented on Android.

$ cd bionic
$ rg "setcontext"
$ rg "getcontext"
$

SteveLauC avatar May 16 '24 10:05 SteveLauC

So there's nothing we can do.

asomers avatar May 16 '24 12:05 asomers