Make more pthread functions weak for native bridge
These are using __pthread_internal_*.
Test: run bionic-unit-tests on cuttlefish
Change-Id: Idbb2503f03bd9f1f2a20fced34b734f573c1c0ad
diff --git a/libc/bionic/pthread_getcpuclockid.cpp b/libc/bionic/pthread_getcpuclockid.cpp
index 0b35998..6d1884e 100644
--- a/libc/bionic/pthread_getcpuclockid.cpp
+++ b/libc/bionic/pthread_getcpuclockid.cpp
@@ -28,8 +28,10 @@
#include <errno.h>
+#include "private/bionic_defs.h"
#include "pthread_internal.h"
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int pthread_getcpuclockid(pthread_t t, clockid_t* clockid) {
pid_t tid = __pthread_internal_gettid(t, "pthread_getcpuclockid");
if (tid == -1) return ESRCH;
diff --git a/libc/bionic/pthread_kill.cpp b/libc/bionic/pthread_kill.cpp
index 8b38f4c..cada9c2 100644
--- a/libc/bionic/pthread_kill.cpp
+++ b/libc/bionic/pthread_kill.cpp
@@ -29,9 +29,11 @@
#include <errno.h>
#include <unistd.h>
+#include "private/bionic_defs.h"
#include "private/ErrnoRestorer.h"
#include "pthread_internal.h"
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int pthread_kill(pthread_t t, int sig) {
ErrnoRestorer errno_restorer;
diff --git a/libc/bionic/pthread_setname_np.cpp b/libc/bionic/pthread_setname_np.cpp
index f673983..5236e4d 100644
--- a/libc/bionic/pthread_setname_np.cpp
+++ b/libc/bionic/pthread_setname_np.cpp
@@ -36,6 +36,7 @@
#include <sys/types.h>
#include <unistd.h>
+#include "private/bionic_defs.h"
#include "private/ErrnoRestorer.h"
#include "pthread_internal.h"
@@ -49,6 +50,7 @@
return open(comm_name, O_CLOEXEC | flags);
}
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int pthread_getname_np(pthread_t t, char* buf, size_t buf_size) {
ErrnoRestorer errno_restorer;
@@ -80,6 +82,7 @@
return 0;
}
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int pthread_setname_np(pthread_t t, const char* thread_name) {
ErrnoRestorer errno_restorer;
diff --git a/libc/bionic/pthread_sigqueue.cpp b/libc/bionic/pthread_sigqueue.cpp
index 5d13ed5..93c349e 100644
--- a/libc/bionic/pthread_sigqueue.cpp
+++ b/libc/bionic/pthread_sigqueue.cpp
@@ -32,9 +32,11 @@
#include <sys/syscall.h>
#include <unistd.h>
+#include "private/bionic_defs.h"
#include "private/ErrnoRestorer.h"
#include "pthread_internal.h"
+__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int pthread_sigqueue(pthread_t t, int sig, const union sigval value) {
ErrnoRestorer errno_restorer;