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/] [signal/] [raise.c] - Blame information for rev 258

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Embedded systems may want the simulated signals if no other form exists,
2
   but UNIX versions will want to use the host facilities.
3
   Define SIMULATED_SIGNALS when you want to use the simulated versions.
4
*/
5
 
6
/*
7
FUNCTION
8
<<raise>>---send a signal
9
 
10
INDEX
11
        raise
12
INDEX
13
        _raise_r
14
 
15
ANSI_SYNOPSIS
16
        #include <signal.h>
17
        int raise(int <[sig]>);
18
 
19
        int _raise_r(void *<[reent]>, int <[sig]>);
20
 
21
TRAD_SYNOPSIS
22
        #include <signal.h>
23
        int raise(<[sig]>)
24
        int <[sig]>;
25
 
26
        int _raise_r(<[reent]>, <[sig]>)
27
        char *<[reent]>;
28
        int <[sig]>;
29
 
30
DESCRIPTION
31
Send the signal <[sig]> (one of the macros from `<<sys/signal.h>>').
32
This interrupts your program's normal flow of execution, and allows a signal
33
handler (if you've defined one, using <<signal>>) to take control.
34
 
35
The alternate function <<_raise_r>> is a reentrant version.  The extra
36
argument <[reent]> is a pointer to a reentrancy structure.
37
 
38
RETURNS
39
The result is <<0>> if <[sig]> was successfully raised, <<1>>
40
otherwise.  However, the return value (since it depends on the normal
41
flow of execution) may not be visible, unless the signal handler for
42
<[sig]> terminates with a <<return>> or unless <<SIG_IGN>> is in
43
effect for this signal.
44
 
45
PORTABILITY
46
ANSI C requires <<raise>>, but allows the full set of signal numbers
47
to vary from one implementation to another.
48
 
49
Required OS subroutines: <<getpid>>, <<kill>>.
50
*/
51
 
52
#ifndef SIGNAL_PROVIDED
53
 
54
int _dummy_raise;
55
 
56
#else
57
 
58
#include <reent.h>
59
#include <signal.h>
60
 
61
#ifndef _REENT_ONLY
62
 
63
int
64
_DEFUN (raise, (sig),
65
        int sig)
66
{
67
  return _raise_r (_REENT, sig);
68
}
69
 
70
#endif
71
 
72
int
73
_DEFUN (_raise_r, (reent, sig),
74
        struct _reent *reent _AND
75
        int sig)
76
{
77
  return _kill_r (reent, _getpid_r (reent), sig);
78
}
79
 
80
#endif /* SIGNAL_PROVIDED */

powered by: WebSVN 2.1.0

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