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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 207 jeremybenn
/* libc/sys/linux/signal.c - Signal handling functions */
2
 
3
/* Written 2000 by Werner Almesberger */
4
 
5
 
6
#include <signal.h>
7
#include <unistd.h>
8
#include <sys/types.h>
9
#include <machine/syscall.h>
10
 
11
/* avoid name space pollution */
12
#define __NR___sgetmask __NR_sgetmask
13
#define __NR___ssetmask __NR_ssetmask
14
#define __NR___rt_sigtimedwait __NR_rt_sigtimedwait
15
#define __NR___rt_sigpending __NR_rt_sigpending
16
#define __NR___rt_sigprocmask __NR_rt_sigprocmask
17
#define __NR___rt_sigsuspend __NR_rt_sigsuspend
18
 
19
_syscall2(int,kill,pid_t,pid,int,sig)
20
_syscall2(__sighandler_t,signal,int,signum,__sighandler_t,handler)
21
_syscall0(int,pause)
22
_syscall1(unsigned int,alarm,unsigned int,seconds)
23
 
24
static _syscall2(int,__rt_sigpending,sigset_t *,set,size_t,size)
25
static _syscall4(int,__rt_sigprocmask,int,how,const sigset_t *,set,sigset_t *,oldset,size_t,size)
26
static _syscall2(int,__rt_sigsuspend,const sigset_t *,mask,size_t,size)
27
static _syscall4(int,__rt_sigtimedwait,const sigset_t *,set,siginfo_t *,info,struct timespec *,timeout,size_t,size)
28
 
29
int __sigsuspend (const sigset_t *mask)
30
{
31
    return __rt_sigsuspend(mask, NSIG/8);
32
}
33
weak_alias(__sigsuspend,sigsuspend)
34
 
35
int sigmask(int signum) /* BSD */
36
{
37
    return 1 << signum;
38
}
39
 
40
int __libc_raise(int sig)
41
{
42
    return kill(getpid(),sig);
43
}
44
weak_alias(__libc_raise,raise)
45
 
46
int __sigpending(sigset_t *set)
47
{
48
  return __rt_sigpending(set, NSIG/8);
49
}
50
weak_alias(__sigpending,sigpending)
51
 
52
int __sigprocmask (int how,const sigset_t *set,sigset_t *oldset)
53
{
54
  return __rt_sigprocmask(how, set, oldset, NSIG/8);
55
}
56
weak_alias(__sigprocmask,sigprocmask)
57
 
58
int sigtimedwait(const sigset_t *set, siginfo_t *info,
59
                 struct timespec *timeout)
60
{
61
  return __rt_sigtimedwait(set, info, timeout, NSIG/8);
62
}
63
 
64
int sigwaitinfo(const sigset_t *set, siginfo_t *info)
65
{
66
  return __rt_sigtimedwait(set, info, NULL, NSIG/8);
67
}
68
 
69
#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 4
70
 
71
static _syscall1(int,__ssetmask,int,newmask)
72
static _syscall0(int,__sgetmask)
73
 
74
int sigblock(int mask) /* BSD */
75
{
76
    return __ssetmask(mask | __sgetmask());
77
}
78
 
79
int sigsetmask(int newmask) /* BSD */
80
{
81
    return __ssetmask(newmask);
82
}
83
#endif
84
 
85
const char *const sys_siglist[] = {
86
#include "siglist.inc"
87
};

powered by: WebSVN 2.1.0

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