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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [signal/] [raise.c] - Diff between revs 1010 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 1010 Rev 1765
/* Embedded systems may want the simulated signals if no other form exists,
/* Embedded systems may want the simulated signals if no other form exists,
   but UNIX versions will want to use the host facilities.
   but UNIX versions will want to use the host facilities.
   Define SIMULATED_SIGNALS when you want to use the simulated versions.
   Define SIMULATED_SIGNALS when you want to use the simulated versions.
*/
*/
 
 
/*
/*
FUNCTION
FUNCTION
<<raise>>---send a signal
<<raise>>---send a signal
 
 
INDEX
INDEX
        raise
        raise
INDEX
INDEX
        _raise_r
        _raise_r
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <signal.h>
        #include <signal.h>
        int raise(int <[sig]>);
        int raise(int <[sig]>);
 
 
        int _raise_r(void *<[reent]>, int <[sig]>);
        int _raise_r(void *<[reent]>, int <[sig]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <signal.h>
        #include <signal.h>
        int raise(<[sig]>)
        int raise(<[sig]>)
        int <[sig]>;
        int <[sig]>;
 
 
        int _raise_r(<[reent]>, <[sig]>)
        int _raise_r(<[reent]>, <[sig]>)
        char *<[reent]>;
        char *<[reent]>;
        int <[sig]>;
        int <[sig]>;
 
 
DESCRIPTION
DESCRIPTION
Send the signal <[sig]> (one of the macros from `<<sys/signal.h>>').
Send the signal <[sig]> (one of the macros from `<<sys/signal.h>>').
This interrupts your program's normal flow of execution, and allows a signal
This interrupts your program's normal flow of execution, and allows a signal
handler (if you've defined one, using <<signal>>) to take control.
handler (if you've defined one, using <<signal>>) to take control.
 
 
The alternate function <<_raise_r>> is a reentrant version.  The extra
The alternate function <<_raise_r>> is a reentrant version.  The extra
argument <[reent]> is a pointer to a reentrancy structure.
argument <[reent]> is a pointer to a reentrancy structure.
 
 
RETURNS
RETURNS
The result is <<0>> if <[sig]> was successfully raised, <<1>>
The result is <<0>> if <[sig]> was successfully raised, <<1>>
otherwise.  However, the return value (since it depends on the normal
otherwise.  However, the return value (since it depends on the normal
flow of execution) may not be visible, unless the signal handler for
flow of execution) may not be visible, unless the signal handler for
<[sig]> terminates with a <<return>> or unless <<SIG_IGN>> is in
<[sig]> terminates with a <<return>> or unless <<SIG_IGN>> is in
effect for this signal.
effect for this signal.
 
 
PORTABILITY
PORTABILITY
ANSI C requires <<raise>>, but allows the full set of signal numbers
ANSI C requires <<raise>>, but allows the full set of signal numbers
to vary from one implementation to another.
to vary from one implementation to another.
 
 
Required OS subroutines: <<getpid>>, <<kill>>.
Required OS subroutines: <<getpid>>, <<kill>>.
*/
*/
 
 
#ifndef SIGNAL_PROVIDED
#ifndef SIGNAL_PROVIDED
 
 
int _dummy_raise;
int _dummy_raise;
 
 
#else
#else
 
 
#include <reent.h>
#include <reent.h>
#include <signal.h>
#include <signal.h>
 
 
#ifndef _REENT_ONLY
#ifndef _REENT_ONLY
 
 
int
int
_DEFUN (raise, (sig),
_DEFUN (raise, (sig),
        int sig)
        int sig)
{
{
  return _raise_r (_REENT, sig);
  return _raise_r (_REENT, sig);
}
}
 
 
#endif
#endif
 
 
int
int
_DEFUN (_raise_r, (reent, sig),
_DEFUN (_raise_r, (reent, sig),
        struct _reent *reent _AND
        struct _reent *reent _AND
        int sig)
        int sig)
{
{
  return _kill_r (reent, _getpid_r (reent), sig);
  return _kill_r (reent, _getpid_r (reent), sig);
}
}
 
 
#endif /* SIGNAL_PROVIDED */
#endif /* SIGNAL_PROVIDED */
 
 

powered by: WebSVN 2.1.0

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