prepare cancellation syscall asm for possibility of __cancel returning

This commit is contained in:
Rich Felker
2015-02-20 20:25:35 -05:00
parent 6bea5dc698
commit f409338a9e
5 changed files with 32 additions and 11 deletions

View File

@ -1,11 +1,18 @@
#include "pthread_impl.h"
#include "syscall.h"
#include "libc.h"
void __cancel()
{
pthread_exit(PTHREAD_CANCELED);
}
/* If __syscall_cp_asm has adjusted the stack pointer, it must provide a
* definition of __cp_cancel to undo those adjustments and call __cancel.
* Otherwise, __cancel provides a definition for __cp_cancel. */
weak_alias(__cancel, __cp_cancel);
long __syscall_cp_asm(volatile void *, syscall_arg_t,
syscall_arg_t, syscall_arg_t, syscall_arg_t,
syscall_arg_t, syscall_arg_t, syscall_arg_t);