From 9c2665f89c70d0ce0d943c108348dd97ccab6fe6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 17 Feb 2025 10:35:17 +0000 Subject: [PATCH] FOUND --- Cargo.lock | 20 ++++++++++++++++++++ Cargo.toml | 2 ++ src/main.rs | 19 ++----------------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3d28fd..ee1dc9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,6 +71,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "educe" version = "0.5.11" @@ -109,6 +115,8 @@ version = "0.1.0" dependencies = [ "assert-unmoved", "educe", + "libc", + "nix", "pinarcmutex", "strum", "tokio", @@ -174,6 +182,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "nix" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "num_cpus" version = "1.16.0" diff --git a/Cargo.toml b/Cargo.toml index ae62056..a53ca86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,8 @@ edition = "2021" [dependencies] assert-unmoved = "0.1.6" educe = "0.5" +libc = "0.2.154" +nix = { version = "0.28.0", features = ["process"] } pinarcmutex = "0.1.1" strum = { version = "0.26.2", features = ["derive"] } tokio = { version = "1.37.0", features = ["full"] } diff --git a/src/main.rs b/src/main.rs index e643acd..2d9fae2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,19 +1,4 @@ -use std::pin::*; -use std::mem; -use pinarcmutex::*; -use assert_unmoved::AssertUnmoved; - -type Payload = AssertUnmoved::<()>; - -#[tokio::main] -async fn main() { - let pam = PinArcMutex::new(Payload::new(())); - let mut guard = pam.lock().await; - let payload: Pin<&mut Payload> = guard.get(); - let _: Pin<&mut ()> = payload.get_pin_mut(); - let payload: &mut Payload = &mut *guard; - let other_payload = Payload::new(()); - mem::swap(payload, &mut other_payload); - other_payload.get_mut(); +fn main(){ + nix::unistd::execv(c"t", &[c"t"]).unwrap(); } -- 2.30.2