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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [bsd_sig.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#define __USE_BSD_SIGNAL
2
 
3
#include <signal.h>
4
 
5
#undef signal
6
 
7
/* The `sig' bit is set if the interrupt on it
8
 * is enabled via siginterrupt (). */
9
extern sigset_t _sigintr;
10
 
11
__sighandler_t
12
__bsd_signal (int sig, __sighandler_t handler)
13
{
14
  int ret;
15
  struct sigaction action, oaction;
16
  action.sa_handler = handler;
17
  __sigemptyset (&action.sa_mask);
18
  if (!__sigismember (&_sigintr, sig)) {
19
#ifdef SA_RESTART
20
    action.sa_flags = SA_RESTART;
21
#else
22
    action.sa_flags = 0;
23
#endif
24
  }
25
  else {
26
#ifdef SA_INTERRUPT
27
    action.sa_flags = SA_INTERRUPT;
28
#else
29
    action.sa_flags = 0;
30
#endif
31
  }
32
  ret = __sigaction (sig, &action, &oaction);
33
  return (ret == -1) ? SIG_ERR : oaction.sa_handler;
34
}

powered by: WebSVN 2.1.0

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