Deleted Added
full compact
linux_signal.c (46571) linux_signal.c (48620)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $Id: linux_signal.c,v 1.14 1998/12/21 19:21:36 sos Exp $
28 * $Id: linux_signal.c,v 1.15 1999/05/06 18:44:26 peter Exp $
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/sysproto.h>
34#include <sys/proc.h>
35#include <sys/signalvar.h>
36

--- 27 unchanged lines hidden (view full) ---

64 }
65 }
66 return new;
67}
68
69static void
70linux_to_bsd_sigaction(linux_sigaction_t *lsa, struct sigaction *bsa)
71{
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/sysproto.h>
34#include <sys/proc.h>
35#include <sys/signalvar.h>
36

--- 27 unchanged lines hidden (view full) ---

64 }
65 }
66 return new;
67}
68
69static void
70linux_to_bsd_sigaction(linux_sigaction_t *lsa, struct sigaction *bsa)
71{
72 bsa->sa_mask = linux_to_bsd_sigset(lsa->sa_mask);
73 bsa->sa_handler = lsa->sa_handler;
72 bsa->sa_mask = linux_to_bsd_sigset(lsa->lsa_mask);
73 bsa->sa_handler = lsa->lsa_handler;
74 bsa->sa_flags = 0;
74 bsa->sa_flags = 0;
75 if (lsa->sa_flags & LINUX_SA_NOCLDSTOP)
75 if (lsa->lsa_flags & LINUX_SA_NOCLDSTOP)
76 bsa->sa_flags |= SA_NOCLDSTOP;
76 bsa->sa_flags |= SA_NOCLDSTOP;
77 if (lsa->sa_flags & LINUX_SA_ONSTACK)
77 if (lsa->lsa_flags & LINUX_SA_ONSTACK)
78 bsa->sa_flags |= SA_ONSTACK;
78 bsa->sa_flags |= SA_ONSTACK;
79 if (lsa->sa_flags & LINUX_SA_RESTART)
79 if (lsa->lsa_flags & LINUX_SA_RESTART)
80 bsa->sa_flags |= SA_RESTART;
80 bsa->sa_flags |= SA_RESTART;
81 if (lsa->sa_flags & LINUX_SA_ONESHOT)
81 if (lsa->lsa_flags & LINUX_SA_ONESHOT)
82 bsa->sa_flags |= SA_RESETHAND;
82 bsa->sa_flags |= SA_RESETHAND;
83 if (lsa->sa_flags & LINUX_SA_NOMASK)
83 if (lsa->lsa_flags & LINUX_SA_NOMASK)
84 bsa->sa_flags |= SA_NODEFER;
85}
86
87static void
88bsd_to_linux_sigaction(struct sigaction *bsa, linux_sigaction_t *lsa)
89{
84 bsa->sa_flags |= SA_NODEFER;
85}
86
87static void
88bsd_to_linux_sigaction(struct sigaction *bsa, linux_sigaction_t *lsa)
89{
90 lsa->sa_handler = bsa->sa_handler;
91 lsa->sa_restorer = NULL; /* unsupported */
92 lsa->sa_mask = bsd_to_linux_sigset(bsa->sa_mask);
93 lsa->sa_flags = 0;
90 lsa->lsa_handler = bsa->sa_handler;
91 lsa->lsa_restorer = NULL; /* unsupported */
92 lsa->lsa_mask = bsd_to_linux_sigset(bsa->sa_mask);
93 lsa->lsa_flags = 0;
94 if (bsa->sa_flags & SA_NOCLDSTOP)
94 if (bsa->sa_flags & SA_NOCLDSTOP)
95 lsa->sa_flags |= LINUX_SA_NOCLDSTOP;
95 lsa->lsa_flags |= LINUX_SA_NOCLDSTOP;
96 if (bsa->sa_flags & SA_ONSTACK)
96 if (bsa->sa_flags & SA_ONSTACK)
97 lsa->sa_flags |= LINUX_SA_ONSTACK;
97 lsa->lsa_flags |= LINUX_SA_ONSTACK;
98 if (bsa->sa_flags & SA_RESTART)
98 if (bsa->sa_flags & SA_RESTART)
99 lsa->sa_flags |= LINUX_SA_RESTART;
99 lsa->lsa_flags |= LINUX_SA_RESTART;
100 if (bsa->sa_flags & SA_RESETHAND)
100 if (bsa->sa_flags & SA_RESETHAND)
101 lsa->sa_flags |= LINUX_SA_ONESHOT;
101 lsa->lsa_flags |= LINUX_SA_ONESHOT;
102 if (bsa->sa_flags & SA_NODEFER)
102 if (bsa->sa_flags & SA_NODEFER)
103 lsa->sa_flags |= LINUX_SA_NOMASK;
103 lsa->lsa_flags |= LINUX_SA_NOMASK;
104}
105
106int
107linux_sigaction(struct proc *p, struct linux_sigaction_args *args)
108{
109 linux_sigaction_t linux_sa;
110 struct sigaction *nsa = NULL, *osa = NULL, bsd_sa;
111 struct sigaction_args sa;

--- 214 unchanged lines hidden ---
104}
105
106int
107linux_sigaction(struct proc *p, struct linux_sigaction_args *args)
108{
109 linux_sigaction_t linux_sa;
110 struct sigaction *nsa = NULL, *osa = NULL, bsd_sa;
111 struct sigaction_args sa;

--- 214 unchanged lines hidden ---