mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
Merge r9426, r9427 ('pending' portability tweaks) from the DARWIN branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9428
This commit is contained in:
parent
f3630f66e8
commit
272ecb8e5d
@ -1381,6 +1381,7 @@ AC_CHECK_FUNCS([ \
|
||||
pthread_spin_lock \
|
||||
semtimedop \
|
||||
signalfd \
|
||||
sigwaitinfo \
|
||||
syscall \
|
||||
strchr \
|
||||
strdup \
|
||||
|
||||
@ -10,13 +10,15 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "config.h"
|
||||
|
||||
static volatile int gotsig = 0;
|
||||
static volatile int early = 1;
|
||||
|
||||
static void handler(int sig)
|
||||
{
|
||||
printf("4: got signal %d\n", sig);
|
||||
printf("4: got signal %s\n",
|
||||
( sig == SIGUSR1 ? "SIGUSR1" : "unexpected signal" ));
|
||||
|
||||
if (sig != SIGUSR1) {
|
||||
fprintf(stderr, "FAILED: got signal %d instead\n", sig);
|
||||
@ -35,7 +37,6 @@ int main()
|
||||
{
|
||||
sigset_t all;
|
||||
sigset_t sigusr1;
|
||||
siginfo_t info;
|
||||
|
||||
sigfillset(&all);
|
||||
sigemptyset(&sigusr1);
|
||||
@ -69,15 +70,20 @@ int main()
|
||||
}
|
||||
|
||||
printf("6: checking SIGUSR2 still pending...\n");
|
||||
if (sigwaitinfo(&all, &info) == -1) {
|
||||
perror("FAILED: sigwaitinfo failed");
|
||||
return 1;
|
||||
}
|
||||
if (info.si_signo != SIGUSR2) {
|
||||
fprintf(stderr, "FAILED: SIGUSR2 not still pending; got signal %d\n",
|
||||
info.si_signo);
|
||||
return 1;
|
||||
# if HAVE_SIGWAITINFO
|
||||
{
|
||||
siginfo_t info;
|
||||
if (sigwaitinfo(&all, &info) == -1) {
|
||||
perror("FAILED: sigwaitinfo failed");
|
||||
return 1;
|
||||
}
|
||||
if (info.si_signo != SIGUSR2) {
|
||||
fprintf(stderr, "FAILED: SIGUSR2 not still pending; got signal %d\n",
|
||||
info.si_signo);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
printf("OK\n");
|
||||
return 0;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
1: sending signal
|
||||
2: sleeping
|
||||
3: unblocking
|
||||
4: got signal 10
|
||||
4: got signal SIGUSR1
|
||||
5: unblocked...
|
||||
6: checking SIGUSR2 still pending...
|
||||
OK
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user