Skip to content

Commit a2f804a

Browse files
authored
Implement SYS_gettid. (#163)
Rust's libstd appears to be using `SYS_gettid` now.
1 parent f8bd5ce commit a2f804a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

c-scape/src/syscall.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ unsafe extern "C" fn syscall(number: c_long, mut args: ...) -> *mut c_void {
162162
let flags = args.arg::<c_int>();
163163
without_provenance_mut(libc::pipe2(pipefd, flags) as isize as usize)
164164
}
165+
libc::SYS_gettid => {
166+
without_provenance_mut(rustix::thread::gettid().as_raw_nonzero().get() as _)
167+
}
165168
_ => unimplemented!(
166169
"syscall({:?}); maybe try enabling the \"extra-syscalls\" feature",
167170
number

0 commit comments

Comments
 (0)