linux_signal.c (116173) | linux_signal.c (133816) |
---|---|
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 --- 13 unchanged lines hidden (view full) --- 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 29#include <sys/cdefs.h> | 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 --- 13 unchanged lines hidden (view full) --- 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 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_signal.c 116173 2003-06-10 21:29:12Z obrien $"); | 30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_signal.c 133816 2004-08-16 07:28:16Z tjr $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/proc.h> 37#include <sys/signalvar.h> 38#include <sys/syscallsubr.h> 39#include <sys/sysproto.h> 40 | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/proc.h> 37#include <sys/signalvar.h> 38#include <sys/syscallsubr.h> 39#include <sys/sysproto.h> 40 |
41#include "opt_compat.h" 42 43#if !COMPAT_LINUX32 |
|
41#include <machine/../linux/linux.h> 42#include <machine/../linux/linux_proto.h> | 44#include <machine/../linux/linux.h> 45#include <machine/../linux/linux_proto.h> |
46#else 47#include <machine/../linux32/linux.h> 48#include <machine/../linux32/linux32_proto.h> 49#endif |
|
43#include <compat/linux/linux_signal.h> 44#include <compat/linux/linux_util.h> 45 46void 47linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) 48{ 49 int b, l; 50 --- 34 unchanged lines hidden (view full) --- 85 } 86} 87 88static void 89linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa) 90{ 91 92 linux_to_bsd_sigset(&lsa->lsa_mask, &bsa->sa_mask); | 50#include <compat/linux/linux_signal.h> 51#include <compat/linux/linux_util.h> 52 53void 54linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) 55{ 56 int b, l; 57 --- 34 unchanged lines hidden (view full) --- 92 } 93} 94 95static void 96linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa) 97{ 98 99 linux_to_bsd_sigset(&lsa->lsa_mask, &bsa->sa_mask); |
93 bsa->sa_handler = lsa->lsa_handler; | 100 bsa->sa_handler = PTRIN(lsa->lsa_handler); |
94 bsa->sa_flags = 0; 95 if (lsa->lsa_flags & LINUX_SA_NOCLDSTOP) 96 bsa->sa_flags |= SA_NOCLDSTOP; 97 if (lsa->lsa_flags & LINUX_SA_NOCLDWAIT) 98 bsa->sa_flags |= SA_NOCLDWAIT; 99 if (lsa->lsa_flags & LINUX_SA_SIGINFO) 100 bsa->sa_flags |= SA_SIGINFO; 101 if (lsa->lsa_flags & LINUX_SA_ONSTACK) --- 6 unchanged lines hidden (view full) --- 108 bsa->sa_flags |= SA_NODEFER; 109} 110 111static void 112bsd_to_linux_sigaction(struct sigaction *bsa, l_sigaction_t *lsa) 113{ 114 115 bsd_to_linux_sigset(&bsa->sa_mask, &lsa->lsa_mask); | 101 bsa->sa_flags = 0; 102 if (lsa->lsa_flags & LINUX_SA_NOCLDSTOP) 103 bsa->sa_flags |= SA_NOCLDSTOP; 104 if (lsa->lsa_flags & LINUX_SA_NOCLDWAIT) 105 bsa->sa_flags |= SA_NOCLDWAIT; 106 if (lsa->lsa_flags & LINUX_SA_SIGINFO) 107 bsa->sa_flags |= SA_SIGINFO; 108 if (lsa->lsa_flags & LINUX_SA_ONSTACK) --- 6 unchanged lines hidden (view full) --- 115 bsa->sa_flags |= SA_NODEFER; 116} 117 118static void 119bsd_to_linux_sigaction(struct sigaction *bsa, l_sigaction_t *lsa) 120{ 121 122 bsd_to_linux_sigset(&bsa->sa_mask, &lsa->lsa_mask); |
123#if COMPAT_LINUX32 124 lsa->lsa_handler = (uintptr_t)bsa->sa_handler; 125#else |
|
116 lsa->lsa_handler = bsa->sa_handler; | 126 lsa->lsa_handler = bsa->sa_handler; |
117 lsa->lsa_restorer = NULL; /* unsupported */ | 127#endif 128 lsa->lsa_restorer = 0; /* unsupported */ |
118 lsa->lsa_flags = 0; 119 if (bsa->sa_flags & SA_NOCLDSTOP) 120 lsa->lsa_flags |= LINUX_SA_NOCLDSTOP; 121 if (bsa->sa_flags & SA_NOCLDWAIT) 122 lsa->lsa_flags |= LINUX_SA_NOCLDWAIT; 123 if (bsa->sa_flags & SA_SIGINFO) 124 lsa->lsa_flags |= LINUX_SA_SIGINFO; 125 if (bsa->sa_flags & SA_ONSTACK) --- 54 unchanged lines hidden (view full) --- 180 args->sig, (void *)args->handler); 181#endif 182 183 nsa.lsa_handler = args->handler; 184 nsa.lsa_flags = LINUX_SA_ONESHOT | LINUX_SA_NOMASK; 185 LINUX_SIGEMPTYSET(nsa.lsa_mask); 186 187 error = linux_do_sigaction(td, args->sig, &nsa, &osa); | 129 lsa->lsa_flags = 0; 130 if (bsa->sa_flags & SA_NOCLDSTOP) 131 lsa->lsa_flags |= LINUX_SA_NOCLDSTOP; 132 if (bsa->sa_flags & SA_NOCLDWAIT) 133 lsa->lsa_flags |= LINUX_SA_NOCLDWAIT; 134 if (bsa->sa_flags & SA_SIGINFO) 135 lsa->lsa_flags |= LINUX_SA_SIGINFO; 136 if (bsa->sa_flags & SA_ONSTACK) --- 54 unchanged lines hidden (view full) --- 191 args->sig, (void *)args->handler); 192#endif 193 194 nsa.lsa_handler = args->handler; 195 nsa.lsa_flags = LINUX_SA_ONESHOT | LINUX_SA_NOMASK; 196 LINUX_SIGEMPTYSET(nsa.lsa_mask); 197 198 error = linux_do_sigaction(td, args->sig, &nsa, &osa); |
188 td->td_retval[0] = (int)osa.lsa_handler; | 199 td->td_retval[0] = (int)(intptr_t)osa.lsa_handler; |
189 190 return (error); 191} 192#endif /*!__alpha__*/ 193 194int 195linux_rt_sigaction(struct thread *td, struct linux_rt_sigaction_args *args) 196{ --- 232 unchanged lines hidden --- | 200 201 return (error); 202} 203#endif /*!__alpha__*/ 204 205int 206linux_rt_sigaction(struct thread *td, struct linux_rt_sigaction_args *args) 207{ --- 232 unchanged lines hidden --- |