mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-05 11:10:21 +00:00
Note that it is unclear if the PRE syscall for rt_sigsuspend is properly setting up a temporary mask in the thread state tmp_sig_mask: if an handler is called while a thread is calling sigsuspend, the mask during the handler run must be the temporary mask set by sigsuspend. It is not clear if/where the valgrind sigframe builder/handler sets the tmp_sig_mask to the value as expected by the user (i.e. the value of the temporary mask which was given to the sigsuspend syscall) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16141
25 lines
408 B
C
25 lines
408 B
C
#include <stdlib.h>
|
|
#include <pthread.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <signal.h>
|
|
static void* t_fn(void* v)
|
|
{
|
|
sigset_t mask;
|
|
|
|
sigfillset(&mask);
|
|
sigsuspend(&mask);
|
|
return NULL;
|
|
}
|
|
|
|
int main (int argc, char *argv[])
|
|
{
|
|
pthread_t t1;
|
|
|
|
pthread_create(&t1, NULL, t_fn, NULL);
|
|
|
|
sleep(1); // Should be enough to have the thread in sigsuspend
|
|
// printf("dying\n");
|
|
exit(0);
|
|
}
|