Deleted Added
full compact
linux_signal.c (69539) linux_signal.c (70061)
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 * $FreeBSD: head/sys/compat/linux/linux_signal.c 69539 2000-12-03 01:30:31Z marcel $
28 * $FreeBSD: head/sys/compat/linux/linux_signal.c 70061 2000-12-15 19:41:27Z jhb $
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

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

226
227 return (error);
228}
229
230static int
231linux_do_sigprocmask(struct proc *p, int how, linux_sigset_t *new,
232 linux_sigset_t *old)
233{
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

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

226
227 return (error);
228}
229
230static int
231linux_do_sigprocmask(struct proc *p, int how, linux_sigset_t *new,
232 linux_sigset_t *old)
233{
234 int error, s;
234 int error;
235 sigset_t mask;
236
237 error = 0;
238 p->p_retval[0] = 0;
239
235 sigset_t mask;
236
237 error = 0;
238 p->p_retval[0] = 0;
239
240 PROC_LOCK(p);
240 if (old != NULL)
241 bsd_to_linux_sigset(&p->p_sigmask, old);
242
243 if (new != NULL) {
244 linux_to_bsd_sigset(new, &mask);
245
241 if (old != NULL)
242 bsd_to_linux_sigset(&p->p_sigmask, old);
243
244 if (new != NULL) {
245 linux_to_bsd_sigset(new, &mask);
246
246 s = splhigh();
247
248 switch (how) {
249 case LINUX_SIG_BLOCK:
250 SIGSETOR(p->p_sigmask, mask);
251 SIG_CANTMASK(p->p_sigmask);
252 break;
253 case LINUX_SIG_UNBLOCK:
254 SIGSETNAND(p->p_sigmask, mask);
255 break;
256 case LINUX_SIG_SETMASK:
257 p->p_sigmask = mask;
258 SIG_CANTMASK(p->p_sigmask);
259 break;
260 default:
261 error = EINVAL;
262 break;
263 }
247 switch (how) {
248 case LINUX_SIG_BLOCK:
249 SIGSETOR(p->p_sigmask, mask);
250 SIG_CANTMASK(p->p_sigmask);
251 break;
252 case LINUX_SIG_UNBLOCK:
253 SIGSETNAND(p->p_sigmask, mask);
254 break;
255 case LINUX_SIG_SETMASK:
256 p->p_sigmask = mask;
257 SIG_CANTMASK(p->p_sigmask);
258 break;
259 default:
260 error = EINVAL;
261 break;
262 }
264
265 splx(s);
266 }
263 }
264 PROC_UNLOCK(p);
267
268 return (error);
269}
270
271#ifndef __alpha__
272int
273linux_sigprocmask(struct proc *p, struct linux_sigprocmask_args *args)
274{

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

338linux_siggetmask(struct proc *p, struct linux_siggetmask_args *args)
339{
340 linux_sigset_t mask;
341
342#ifdef DEBUG
343 printf("Linux-emul(%d): siggetmask()\n", p->p_pid);
344#endif
345
265
266 return (error);
267}
268
269#ifndef __alpha__
270int
271linux_sigprocmask(struct proc *p, struct linux_sigprocmask_args *args)
272{

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

336linux_siggetmask(struct proc *p, struct linux_siggetmask_args *args)
337{
338 linux_sigset_t mask;
339
340#ifdef DEBUG
341 printf("Linux-emul(%d): siggetmask()\n", p->p_pid);
342#endif
343
344 PROC_LOCK(p);
346 bsd_to_linux_sigset(&p->p_sigmask, &mask);
345 bsd_to_linux_sigset(&p->p_sigmask, &mask);
346 PROC_UNLOCK(p);
347 p->p_retval[0] = mask.__bits[0];
348 return (0);
349}
350
351int
352linux_sigsetmask(struct proc *p, struct linux_sigsetmask_args *args)
353{
354 linux_sigset_t lset;
355 sigset_t bset;
347 p->p_retval[0] = mask.__bits[0];
348 return (0);
349}
350
351int
352linux_sigsetmask(struct proc *p, struct linux_sigsetmask_args *args)
353{
354 linux_sigset_t lset;
355 sigset_t bset;
356 int s;
357
358#ifdef DEBUG
359 printf("Linux-emul(%ld): sigsetmask(%08lx)\n",
360 (long)p->p_pid, (unsigned long)args->mask);
361#endif
362
356
357#ifdef DEBUG
358 printf("Linux-emul(%ld): sigsetmask(%08lx)\n",
359 (long)p->p_pid, (unsigned long)args->mask);
360#endif
361
362 PROC_LOCK(p);
363 bsd_to_linux_sigset(&p->p_sigmask, &lset);
364 p->p_retval[0] = lset.__bits[0];
365 LINUX_SIGEMPTYSET(lset);
366 lset.__bits[0] = args->mask;
367 linux_to_bsd_sigset(&lset, &bset);
363 bsd_to_linux_sigset(&p->p_sigmask, &lset);
364 p->p_retval[0] = lset.__bits[0];
365 LINUX_SIGEMPTYSET(lset);
366 lset.__bits[0] = args->mask;
367 linux_to_bsd_sigset(&lset, &bset);
368 s = splhigh();
369 p->p_sigmask = bset;
370 SIG_CANTMASK(p->p_sigmask);
368 p->p_sigmask = bset;
369 SIG_CANTMASK(p->p_sigmask);
371 splx(s);
370 PROC_UNLOCK(p);
372 return (0);
373}
374
375int
376linux_sigpending(struct proc *p, struct linux_sigpending_args *args)
377{
378 sigset_t bset;
379 linux_sigset_t lset;
380 linux_osigset_t mask;
381
382#ifdef DEBUG
383 printf("Linux-emul(%d): sigpending(*)\n", p->p_pid);
384#endif
385
371 return (0);
372}
373
374int
375linux_sigpending(struct proc *p, struct linux_sigpending_args *args)
376{
377 sigset_t bset;
378 linux_sigset_t lset;
379 linux_osigset_t mask;
380
381#ifdef DEBUG
382 printf("Linux-emul(%d): sigpending(*)\n", p->p_pid);
383#endif
384
385 PROC_LOCK(p);
386 bset = p->p_siglist;
387 SIGSETAND(bset, p->p_sigmask);
388 bsd_to_linux_sigset(&bset, &lset);
386 bset = p->p_siglist;
387 SIGSETAND(bset, p->p_sigmask);
388 bsd_to_linux_sigset(&bset, &lset);
389 PROC_UNLOCK(p);
389 mask = lset.__bits[0];
390 return (copyout(&mask, args->mask, sizeof(mask)));
391}
392#endif /*!__alpha__*/
393
394int
395linux_kill(struct proc *p, struct linux_kill_args *args)
396{

--- 26 unchanged lines hidden ---
390 mask = lset.__bits[0];
391 return (copyout(&mask, args->mask, sizeof(mask)));
392}
393#endif /*!__alpha__*/
394
395int
396linux_kill(struct proc *p, struct linux_kill_args *args)
397{

--- 26 unchanged lines hidden ---