~ubuntu-branches/ubuntu/wily/qemu-kvm-spice/wily

« back to all changes in this revision

Viewing changes to tests/cris/check_sigalrm.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-10-19 10:44:56 UTC
  • Revision ID: james.westby@ubuntu.com-20111019104456-xgvskumk3sxi97f4
Tags: upstream-0.15.0+noroms
ImportĀ upstreamĀ versionĀ 0.15.0+noroms

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include <signal.h>
 
4
#include <unistd.h>
 
5
 
 
6
#define MAGIC (0xdeadbeef)
 
7
 
 
8
int s = 0;
 
9
void sighandler(int sig)
 
10
{
 
11
        s = MAGIC;
 
12
}
 
13
 
 
14
int main(int argc, char **argv)
 
15
{
 
16
        int p;
 
17
 
 
18
        p = getpid();
 
19
        signal(SIGALRM, sighandler);
 
20
        kill(p, SIGALRM);
 
21
        if (s != MAGIC)
 
22
                return EXIT_FAILURE;
 
23
 
 
24
        printf ("passed\n");
 
25
        return EXIT_SUCCESS;
 
26
}