Blame src/regression/sigreturn.c
|
Szabolcs Nagy |
cfa23c |
// commit: dc3776d445957cd3ea4a682db518701b93d34292 2011-02-13
|
|
Szabolcs Nagy |
cfa23c |
// sigreturn crash
|
|
Szabolcs Nagy |
cfa23c |
#include <signal.h>
|
|
Szabolcs Nagy |
cfa23c |
|
|
Szabolcs Nagy |
cfa23c |
static volatile sig_atomic_t x;
|
|
Szabolcs Nagy |
cfa23c |
|
|
Szabolcs Nagy |
cfa23c |
void handler(int s)
|
|
Szabolcs Nagy |
cfa23c |
{
|
|
Szabolcs Nagy |
cfa23c |
x = 1;
|
|
Szabolcs Nagy |
cfa23c |
}
|
|
Szabolcs Nagy |
cfa23c |
|
|
Szabolcs Nagy |
cfa23c |
int main(void)
|
|
Szabolcs Nagy |
cfa23c |
{
|
|
Szabolcs Nagy |
cfa23c |
signal(SIGINT, handler);
|
|
Szabolcs Nagy |
cfa23c |
if (raise(SIGINT))
|
|
Szabolcs Nagy |
cfa23c |
return 2;
|
|
Szabolcs Nagy |
cfa23c |
if (x != 1)
|
|
Szabolcs Nagy |
cfa23c |
return 1;
|
|
Szabolcs Nagy |
cfa23c |
return 0;
|
|
Szabolcs Nagy |
cfa23c |
}
|