OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.base/] [interrupt.c] - Blame information for rev 227

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
#include <errno.h>
2
#include <stdio.h>
3
#include <unistd.h>
4
#include <stdlib.h>
5
 
6
#ifdef SIGNALS
7
#include <signal.h>
8
 
9
static void
10
sigint_handler (int signo)
11
{
12
}
13
#endif
14
 
15
int
16
main ()
17
{
18
  char x;
19
  int nbytes;
20
#ifdef usestubs
21
  set_debug_traps();
22
  breakpoint();
23
#endif
24
#ifdef SIGNALS
25
  signal (SIGINT, sigint_handler);
26
#endif
27
  printf ("talk to me baby\n");
28
  while (1)
29
    {
30
      nbytes = read (0, &x, 1);
31
      if (nbytes < 0)
32
        {
33
#ifdef EINTR
34
          if (errno != EINTR)
35
#endif
36
            {
37
              perror ("");
38
              return 1;
39
            }
40
        }
41
      else if (nbytes == 0)
42
        {
43
          printf ("end of file\n");
44
          exit (0);
45
        }
46
      else
47
        write (1, &x, 1);
48
    }
49
  return 0;
50
}
51
 
52
int
53
func1 ()
54
{
55
  return 4;
56
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.