mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-11 05:55:48 +00:00
suite-proper, giving them .vgtest files and all that. They don't make sense for 1.0.X because the client request constants are different in HEAD, indeed one of them (clientperm) fails with --stable. Also moved blocked_syscall.c from tests/ to tests/unused/. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1181
33 lines
645 B
C
33 lines
645 B
C
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <assert.h>
|
|
#include <signal.h>
|
|
|
|
int fds[2];
|
|
|
|
void the_sighandler ( int signo )
|
|
{
|
|
int nw;
|
|
// assert(signo == SIGUSR1);
|
|
printf("sighandler running; should unblock now\n");
|
|
nw = write(fds[1], "zzz", 1);
|
|
// assert(nw == 1);
|
|
}
|
|
|
|
int main ( void )
|
|
{
|
|
char buf[10];
|
|
int res, nr;
|
|
void* oldsh = signal(SIGUSR1, the_sighandler);
|
|
assert(oldsh != SIG_ERR);
|
|
printf("pid = %d\n", getpid());
|
|
res = pipe(fds);
|
|
assert (res == 0);
|
|
printf("doing read(); this should block\n");
|
|
nr = read(fds[0], buf, 1);
|
|
/* blocks */
|
|
printf("read returned %d\n", nr);
|
|
return 0;
|
|
}
|