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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [sys/] [linux/] [strsignal.c] - Blame information for rev 207

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#include <string.h>
2
#include <signal.h>
3
#include <stdio.h>
4
#include <reent.h>
5
 
6
static const char *sigstring[] =
7
  {
8
    "Signal 0",
9
    "Hangup",
10
    "Interrupt",
11
    "Quit",
12
    "Illegal instruction",
13
    "Trace/breakpoint trap",
14
    "IOT trap",
15
    "EMT trap",
16
    "Floating point exception",
17
    "Killed",
18
    "Bus error",
19
    "Segmentation fault",
20
    "Bad system call",
21
    "Broken pipe",
22
    "Alarm clock",
23
    "Terminated",
24
    "Urgent I/O condition",
25
    "Stopped (signal)",
26
    "Stopped",
27
    "Continued",
28
    "Child exited",
29
    "Stopped (tty input)",
30
    "Stopped (tty output)",
31
    "I/O possible",
32
    "CPU time limit exceeded",
33
    "File size limit exceeded",
34
    "Virtual timer expired",
35
    "Profiling timer expired",
36
    "Window changed",
37
    "Resource lost",
38
    "User defined signal 1",
39
    "User defined signal 2"
40
  };
41
 
42
char *
43
strsignal (int sig)
44
{
45
  if (sig < 0 || sig >= __SIGRTMIN)
46
    {
47
      char *buffer;
48
      struct _reent *ptr;
49
 
50
      ptr = _REENT;
51
 
52
      _REENT_CHECK_SIGNAL_BUF(ptr);
53
      buffer = _REENT_SIGNAL_BUF(ptr);
54
 
55
      if (sig < 0 || sig > __SIGRTMAX)
56
        siprintf (buffer, "Unknown signal %d", sig);
57
      else
58
        siprintf (buffer, "Real-time signal %d", sig - __SIGRTMIN);
59
      return buffer;
60
    }
61
  else
62
    return sigstring[sig];
63
}

powered by: WebSVN 2.1.0

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