mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
This avoids having consumers import libc for common signals, and it improves discoverability since users need not be aware that libc contains all supported constants.
18 lines
331 B
Rust
18 lines
331 B
Rust
#![cfg(unix)]
|
|
#![warn(rust_2018_idioms)]
|
|
#![feature(async_await)]
|
|
|
|
pub mod support;
|
|
use crate::support::*;
|
|
|
|
use libc;
|
|
|
|
#[tokio::test]
|
|
async fn simple() {
|
|
let signal = Signal::new(SignalKind::sigusr1()).expect("failed to create signal");
|
|
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
let _ = with_timeout(signal.into_future()).await;
|
|
}
|