rustc/vendor/curl-0.4.47/tests/atexit.rs
2025-01-11 15:57:26 +01:00

18 lines
328 B
Rust

use curl::easy::Easy;
pub extern "C" fn hook() {
let mut easy = Easy::new();
easy.url("google.com").unwrap();
easy.write_function(|data| Ok(data.len())).unwrap();
easy.perform().unwrap();
}
fn main() {
curl::init();
hook();
unsafe {
libc::atexit(hook);
}
println!("Finishing...")
}