Skip to content

Commit 3a7135f

Browse files
committed
Auto merge of #2100 - TheDoctor314:gettid, r=JohnTitor
Add gettid() for Linux Fixes #2076
2 parents ec86e5f + b719be4 commit 3a7135f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,6 +2737,9 @@ fn test_linux(target: &str) {
27372737
// assume it's a int instead.
27382738
"getnameinfo" if uclibc => true,
27392739

2740+
// FIXME: This needs musl 1.2.2 or later.
2741+
"gettid" if musl => true,
2742+
27402743
_ => false,
27412744
}
27422745
});

src/unix/linux_like/android/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,6 +2809,8 @@ extern "C" {
28092809
pub fn regfree(preg: *mut ::regex_t);
28102810

28112811
pub fn android_set_abort_message(msg: *const ::c_char);
2812+
2813+
pub fn gettid() -> ::pid_t;
28122814
}
28132815

28142816
cfg_if! {

src/unix/linux_like/linux/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,6 +3594,8 @@ extern "C" {
35943594
outbytesleft: *mut ::size_t,
35953595
) -> ::size_t;
35963596
pub fn iconv_close(cd: iconv_t) -> ::c_int;
3597+
3598+
pub fn gettid() -> ::pid_t;
35973599
}
35983600

35993601
cfg_if! {

0 commit comments

Comments
 (0)