diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 12b3e482b5..eb4908f331 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -1584,6 +1584,11 @@ pub fn clone2(flags: u32, child_stack_ptr: usize) usize { return syscall2(.clone, flags, child_stack_ptr); } +/// This call cannot fail, and the return value is the caller's thread id +pub fn set_tid_address(tidptr: ?*pid_t) pid_t { + return @intCast(@as(u32, @truncate(syscall1(.set_tid_address, @intFromPtr(tidptr))))); +} + pub fn close(fd: fd_t) usize { return syscall1(.close, @as(usize, @bitCast(@as(isize, fd)))); }