mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Replace libc with rustix in some modules
Unfortunately this isn't a total removal, for two reasons: - We still need "libc" for the Xlib XIM implementation, for locales. - BSD requires libc to check for main-threadedness. First one we can likely resolve in the near future, not so sure about the second one without using some weird pthreads trick.
This commit is contained in:
committed by
Kirill Chibisov
parent
afebe2e7d1
commit
62b4ba8b50
@@ -935,9 +935,7 @@ fn sticky_exit_callback<T, F>(
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn is_main_thread() -> bool {
|
||||
use libc::{c_long, getpid, syscall, SYS_gettid};
|
||||
|
||||
unsafe { syscall(SYS_gettid) == getpid() as c_long }
|
||||
rustix::thread::gettid() == rustix::process::getpid()
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))]
|
||||
|
||||
Reference in New Issue
Block a user