1
0
Fork 0
forked from wry/wry

xwayland: kill xwayland when wayland connection fails

This commit is contained in:
Julian Orth 2025-05-04 19:02:35 +02:00
parent 9840150e40
commit 8b9784bb15
6 changed files with 42 additions and 1 deletions

View file

@ -0,0 +1,23 @@
use {
crate::utils::oserror::OsError,
c::{c_int, syscall},
std::{ptr, rc::Rc},
uapi::{
OwnedFd,
c::{self, SYS_pidfd_send_signal, siginfo_t},
map_err,
},
};
pub fn pidfd_send_signal(pidfd: &Rc<OwnedFd>, signal: c_int) -> Result<(), OsError> {
let res = unsafe {
syscall(
SYS_pidfd_send_signal,
pidfd.raw(),
signal,
ptr::null_mut::<siginfo_t>(),
0,
)
};
map_err!(res).map(drop).map_err(|e| e.into())
}