+#include <string.h>
#include "pthread_impl.h"
#include "syscall.h"
#include "libc.h"
+#ifdef SHARED
+__attribute__((__visibility__("hidden")))
+#endif
+long __cancel(), __cp_cancel(), __syscall_cp_asm(), __syscall_cp_c();
+
long __cancel()
{
pthread_t self = __pthread_self();
long r;
int st;
- if (!libc.has_thread_pointer || (st=(self=__pthread_self())->canceldisable)
+ if ((st=(self=__pthread_self())->canceldisable)
&& (st==PTHREAD_CANCEL_DISABLE || nr==SYS_close))
return __syscall(nr, u, v, w, x, y, z);
set->__bits[s/8/sizeof *set->__bits] |= 1UL<<(s&8*sizeof *set->__bits-1);
}
+#ifdef SHARED
+__attribute__((__visibility__("hidden")))
+#endif
+extern const char __cp_begin[1], __cp_end[1];
+
static void cancel_handler(int sig, siginfo_t *si, void *ctx)
{
pthread_t self = __pthread_self();
ucontext_t *uc = ctx;
const char *ip = ((char **)&uc->uc_mcontext)[CANCEL_REG_IP];
- extern const char __cp_begin[1], __cp_end[1];
a_barrier();
if (!self->cancel || self->canceldisable == PTHREAD_CANCEL_DISABLE) return;
void __testcancel()
{
- if (!libc.has_thread_pointer) return;
pthread_t self = __pthread_self();
if (self->cancel && !self->canceldisable)
__cancel();
.sa_flags = SA_SIGINFO | SA_RESTART,
.sa_sigaction = cancel_handler
};
- sigfillset(&sa.sa_mask);
+ memset(&sa.sa_mask, -1, _NSIG/8);
__libc_sigaction(SIGCANCEL, &sa, 0);
}