From d36e7e0c7057cb1b9207e9a346b9f1535818196c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 24 Oct 2025 18:00:19 -0700 Subject: [PATCH] Implement `SYS_gettid`. Rust's libstd appears to be using `SYS_gettid` now. --- c-scape/src/syscall.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/c-scape/src/syscall.rs b/c-scape/src/syscall.rs index 52d4ddf..caa3f41 100644 --- a/c-scape/src/syscall.rs +++ b/c-scape/src/syscall.rs @@ -162,6 +162,9 @@ unsafe extern "C" fn syscall(number: c_long, mut args: ...) -> *mut c_void { let flags = args.arg::(); without_provenance_mut(libc::pipe2(pipefd, flags) as isize as usize) } + libc::SYS_gettid => { + without_provenance_mut(rustix::thread::gettid().as_raw_nonzero().get() as _) + } _ => unimplemented!( "syscall({:?}); maybe try enabling the \"extra-syscalls\" feature", number