Deleted Added
sdiff udiff text old ( 69539 ) new ( 70061 )
full compact
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 $
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;
235 sigset_t mask;
236
237 error = 0;
238 p->p_retval[0] = 0;
239
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
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 }
264
265 splx(s);
266 }
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
346 bsd_to_linux_sigset(&p->p_sigmask, &mask);
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
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);
371 splx(s);
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
386 bset = p->p_siglist;
387 SIGSETAND(bset, p->p_sigmask);
388 bsd_to_linux_sigset(&bset, &lset);
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 ---