authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-18 00:03:24 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-18 00:03:24 -08:00
logb909bdac4648a27c7a4cde2cb991d90221a36949
tree5c9f39115b0b326e0c44f417588005246efb1170
parent8b430df52d95956e12163ff976af7fda6712a341

add gettid


2 files changed, 6 insertions(+), 0 deletions(-)

mod.zig+5
...@@ -1388,6 +1388,7 @@ pub const libc = struct {...@@ -1388,6 +1388,7 @@ pub const libc = struct {
1388 //1388 //
13891389
1390 pub extern fn __errno_location() *c_int;1390 pub extern fn __errno_location() *c_int;
1391 pub extern fn gettid() pid_t;
1391};1392};
13921393
1393pub const clock_t = c_long;1394pub const clock_t = c_long;
...@@ -1533,3 +1534,7 @@ pub fn mkdirat(fd: c_int, path: [*:0]const u8, mode: mode_t) errno.Error!void {...@@ -1533,3 +1534,7 @@ pub fn mkdirat(fd: c_int, path: [*:0]const u8, mode: mode_t) errno.Error!void {
1533pub fn pthread_self() pthread_t {1534pub fn pthread_self() pthread_t {
1534 return libc.pthread_self();1535 return libc.pthread_self();
1535}1536}
1537
1538pub fn gettid() pid_t {
1539 return libc.gettid();
1540}
test.zig+1
...@@ -14,4 +14,5 @@ test {...@@ -14,4 +14,5 @@ test {
14 _ = &linux.readv;14 _ = &linux.readv;
15 _ = &linux.mkdirat;15 _ = &linux.mkdirat;
16 _ = &linux.pthread_self;16 _ = &linux.pthread_self;
17 _ = &linux.gettid;
17}18}