linux_signal.c revision 1.12 1 1.12 mycroft /* $NetBSD: linux_signal.c,v 1.12 1998/09/11 12:50:09 mycroft Exp $ */
2 1.1 fvdl
3 1.1 fvdl /*
4 1.1 fvdl * Copyright (c) 1995 Frank van der Linden
5 1.1 fvdl * All rights reserved.
6 1.1 fvdl *
7 1.1 fvdl * Redistribution and use in source and binary forms, with or without
8 1.1 fvdl * modification, are permitted provided that the following conditions
9 1.1 fvdl * are met:
10 1.1 fvdl * 1. Redistributions of source code must retain the above copyright
11 1.1 fvdl * notice, this list of conditions and the following disclaimer.
12 1.1 fvdl * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 fvdl * notice, this list of conditions and the following disclaimer in the
14 1.1 fvdl * documentation and/or other materials provided with the distribution.
15 1.1 fvdl * 3. All advertising materials mentioning features or use of this software
16 1.1 fvdl * must display the following acknowledgement:
17 1.1 fvdl * This product includes software developed for the NetBSD Project
18 1.1 fvdl * by Frank van der Linden
19 1.1 fvdl * 4. The name of the author may not be used to endorse or promote products
20 1.1 fvdl * derived from this software without specific prior written permission
21 1.1 fvdl *
22 1.1 fvdl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 1.1 fvdl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.1 fvdl * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.1 fvdl * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 1.1 fvdl * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 1.1 fvdl * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.1 fvdl * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.1 fvdl * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.1 fvdl * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 1.1 fvdl * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.1 fvdl *
33 1.1 fvdl * heavily from: svr4_signal.c,v 1.7 1995/01/09 01:04:21 christos Exp
34 1.1 fvdl */
35 1.1 fvdl
36 1.1 fvdl #include <sys/param.h>
37 1.1 fvdl #include <sys/systm.h>
38 1.1 fvdl #include <sys/namei.h>
39 1.1 fvdl #include <sys/proc.h>
40 1.1 fvdl #include <sys/filedesc.h>
41 1.1 fvdl #include <sys/ioctl.h>
42 1.1 fvdl #include <sys/mount.h>
43 1.1 fvdl #include <sys/kernel.h>
44 1.1 fvdl #include <sys/signal.h>
45 1.1 fvdl #include <sys/signalvar.h>
46 1.1 fvdl #include <sys/malloc.h>
47 1.1 fvdl
48 1.1 fvdl #include <sys/syscallargs.h>
49 1.1 fvdl
50 1.1 fvdl #include <compat/linux/linux_types.h>
51 1.7 mycroft #include <compat/linux/linux_signal.h>
52 1.1 fvdl #include <compat/linux/linux_syscallargs.h>
53 1.1 fvdl #include <compat/linux/linux_util.h>
54 1.1 fvdl
55 1.6 mycroft #define linux_sigmask(n) (1 << ((n) - 1))
56 1.11 perry #define linux_sigemptyset(s) memset((s), 0, sizeof(*(s)))
57 1.6 mycroft #define linux_sigismember(s, n) (*(s) & linux_sigmask(n))
58 1.6 mycroft #define linux_sigaddset(s, n) (*(s) |= linux_sigmask(n))
59 1.6 mycroft
60 1.12 mycroft int native_to_linux_sig[NSIG] = {
61 1.6 mycroft 0,
62 1.6 mycroft LINUX_SIGHUP,
63 1.6 mycroft LINUX_SIGINT,
64 1.6 mycroft LINUX_SIGQUIT,
65 1.6 mycroft LINUX_SIGILL,
66 1.6 mycroft LINUX_SIGTRAP,
67 1.6 mycroft LINUX_SIGABRT,
68 1.12 mycroft 0, /* SIGEMT */
69 1.6 mycroft LINUX_SIGFPE,
70 1.6 mycroft LINUX_SIGKILL,
71 1.6 mycroft LINUX_SIGBUS,
72 1.6 mycroft LINUX_SIGSEGV,
73 1.12 mycroft 0, /* SIGSEGV */
74 1.6 mycroft LINUX_SIGPIPE,
75 1.6 mycroft LINUX_SIGALRM,
76 1.6 mycroft LINUX_SIGTERM,
77 1.6 mycroft LINUX_SIGURG,
78 1.6 mycroft LINUX_SIGSTOP,
79 1.6 mycroft LINUX_SIGTSTP,
80 1.6 mycroft LINUX_SIGCONT,
81 1.6 mycroft LINUX_SIGCHLD,
82 1.6 mycroft LINUX_SIGTTIN,
83 1.6 mycroft LINUX_SIGTTOU,
84 1.6 mycroft LINUX_SIGIO,
85 1.6 mycroft LINUX_SIGXCPU,
86 1.6 mycroft LINUX_SIGXFSZ,
87 1.6 mycroft LINUX_SIGVTALRM,
88 1.6 mycroft LINUX_SIGPROF,
89 1.6 mycroft LINUX_SIGWINCH,
90 1.12 mycroft 0, /* SIGINFO */
91 1.6 mycroft LINUX_SIGUSR1,
92 1.6 mycroft LINUX_SIGUSR2,
93 1.12 mycroft LINUX_SIGPWR,
94 1.6 mycroft };
95 1.6 mycroft
96 1.12 mycroft int linux_to_native_sig[LINUX_NSIG] = {
97 1.6 mycroft 0,
98 1.6 mycroft SIGHUP,
99 1.6 mycroft SIGINT,
100 1.6 mycroft SIGQUIT,
101 1.6 mycroft SIGILL,
102 1.6 mycroft SIGTRAP,
103 1.6 mycroft SIGABRT,
104 1.6 mycroft SIGBUS,
105 1.6 mycroft SIGFPE,
106 1.6 mycroft SIGKILL,
107 1.6 mycroft SIGUSR1,
108 1.6 mycroft SIGSEGV,
109 1.6 mycroft SIGUSR2,
110 1.6 mycroft SIGPIPE,
111 1.6 mycroft SIGALRM,
112 1.6 mycroft SIGTERM,
113 1.12 mycroft 0, /* SIGSTKFLT */
114 1.6 mycroft SIGCHLD,
115 1.6 mycroft SIGCONT,
116 1.6 mycroft SIGSTOP,
117 1.6 mycroft SIGTSTP,
118 1.6 mycroft SIGTTIN,
119 1.6 mycroft SIGTTOU,
120 1.6 mycroft SIGURG,
121 1.6 mycroft SIGXCPU,
122 1.6 mycroft SIGXFSZ,
123 1.6 mycroft SIGVTALRM,
124 1.6 mycroft SIGPROF,
125 1.6 mycroft SIGWINCH,
126 1.6 mycroft SIGIO,
127 1.12 mycroft SIGPWR,
128 1.12 mycroft 0, /* SIGUNUSED */
129 1.6 mycroft };
130 1.1 fvdl
131 1.10 christos /* linux_signal.c */
132 1.12 mycroft void linux_to_native_sigaction __P((struct linux_sigaction *, struct sigaction *));
133 1.12 mycroft void native_to_linux_sigaction __P((struct sigaction *, struct linux_sigaction *));
134 1.10 christos
135 1.6 mycroft void
136 1.12 mycroft linux_to_native_sigset(lss, bss)
137 1.1 fvdl const linux_sigset_t *lss;
138 1.1 fvdl sigset_t *bss;
139 1.1 fvdl {
140 1.1 fvdl int i, newsig;
141 1.1 fvdl
142 1.6 mycroft sigemptyset(bss);
143 1.6 mycroft for (i = 1; i < LINUX_NSIG; i++) {
144 1.6 mycroft if (linux_sigismember(lss, i)) {
145 1.12 mycroft newsig = linux_to_native_sig[i];
146 1.1 fvdl if (newsig)
147 1.6 mycroft sigaddset(bss, newsig);
148 1.1 fvdl }
149 1.1 fvdl }
150 1.1 fvdl }
151 1.1 fvdl
152 1.1 fvdl void
153 1.12 mycroft native_to_linux_sigset(bss, lss)
154 1.1 fvdl const sigset_t *bss;
155 1.1 fvdl linux_sigset_t *lss;
156 1.1 fvdl {
157 1.1 fvdl int i, newsig;
158 1.1 fvdl
159 1.6 mycroft linux_sigemptyset(lss);
160 1.6 mycroft for (i = 1; i < NSIG; i++) {
161 1.6 mycroft if (sigismember(bss, i)) {
162 1.12 mycroft newsig = native_to_linux_sig[i];
163 1.1 fvdl if (newsig)
164 1.6 mycroft linux_sigaddset(lss, newsig);
165 1.1 fvdl }
166 1.1 fvdl }
167 1.1 fvdl }
168 1.1 fvdl
169 1.1 fvdl /*
170 1.1 fvdl * Convert between Linux and BSD sigaction structures. Linux has
171 1.6 mycroft * one extra field (sa_restorer) which we don't support.
172 1.1 fvdl */
173 1.1 fvdl void
174 1.12 mycroft linux_to_native_sigaction(lsa, bsa)
175 1.1 fvdl struct linux_sigaction *lsa;
176 1.1 fvdl struct sigaction *bsa;
177 1.1 fvdl {
178 1.6 mycroft
179 1.1 fvdl bsa->sa_handler = lsa->sa_handler;
180 1.12 mycroft linux_to_native_sigset(&lsa->sa_mask, &bsa->sa_mask);
181 1.1 fvdl bsa->sa_flags = 0;
182 1.12 mycroft if ((lsa->sa_flags & LINUX_SA_NOCLDSTOP) != 0)
183 1.12 mycroft bsa->sa_flags |= SA_NOCLDSTOP;
184 1.6 mycroft if ((lsa->sa_flags & LINUX_SA_ONSTACK) != 0)
185 1.6 mycroft bsa->sa_flags |= SA_ONSTACK;
186 1.6 mycroft if ((lsa->sa_flags & LINUX_SA_RESTART) != 0)
187 1.6 mycroft bsa->sa_flags |= SA_RESTART;
188 1.6 mycroft if ((lsa->sa_flags & LINUX_SA_ONESHOT) != 0)
189 1.6 mycroft bsa->sa_flags |= SA_RESETHAND;
190 1.6 mycroft if ((lsa->sa_flags & LINUX_SA_NOMASK) != 0)
191 1.6 mycroft bsa->sa_flags |= SA_NODEFER;
192 1.12 mycroft if ((lsa->sa_flags & ~LINUX_SA_ALLBITS) != 0)
193 1.12 mycroft /*XXX*/ printf("linux_to_native_sigaction: extra bits ignored\n");
194 1.12 mycroft if (lsa->sa_restorer != 0)
195 1.12 mycroft /*XXX*/ printf("linux_to_native_sigaction: sa_restorer ignored\n");
196 1.1 fvdl }
197 1.1 fvdl
198 1.1 fvdl void
199 1.12 mycroft native_to_linux_sigaction(bsa, lsa)
200 1.1 fvdl struct sigaction *bsa;
201 1.1 fvdl struct linux_sigaction *lsa;
202 1.1 fvdl {
203 1.6 mycroft
204 1.1 fvdl lsa->sa_handler = bsa->sa_handler;
205 1.12 mycroft native_to_linux_sigset(&bsa->sa_mask, &lsa->sa_mask);
206 1.1 fvdl lsa->sa_flags = 0;
207 1.6 mycroft if ((bsa->sa_flags & SA_NOCLDSTOP) != 0)
208 1.6 mycroft lsa->sa_flags |= LINUX_SA_NOCLDSTOP;
209 1.6 mycroft if ((bsa->sa_flags & SA_ONSTACK) != 0)
210 1.6 mycroft lsa->sa_flags |= LINUX_SA_ONSTACK;
211 1.6 mycroft if ((bsa->sa_flags & SA_RESTART) != 0)
212 1.6 mycroft lsa->sa_flags |= LINUX_SA_RESTART;
213 1.6 mycroft if ((bsa->sa_flags & SA_NODEFER) != 0)
214 1.6 mycroft lsa->sa_flags |= LINUX_SA_NOMASK;
215 1.6 mycroft if ((bsa->sa_flags & SA_RESETHAND) != 0)
216 1.6 mycroft lsa->sa_flags |= LINUX_SA_ONESHOT;
217 1.1 fvdl lsa->sa_restorer = NULL;
218 1.1 fvdl }
219 1.1 fvdl
220 1.1 fvdl
221 1.1 fvdl /*
222 1.1 fvdl * The Linux sigaction() system call. Do the usual conversions,
223 1.1 fvdl * and just call sigaction(). Some flags and values are silently
224 1.1 fvdl * ignored (see above).
225 1.1 fvdl */
226 1.1 fvdl int
227 1.9 mycroft linux_sys_sigaction(p, v, retval)
228 1.1 fvdl register struct proc *p;
229 1.8 thorpej void *v;
230 1.8 thorpej register_t *retval;
231 1.8 thorpej {
232 1.9 mycroft struct linux_sys_sigaction_args /* {
233 1.1 fvdl syscallarg(int) signum;
234 1.12 mycroft syscallarg(const struct linux_sigaction *) nsa;
235 1.1 fvdl syscallarg(struct linux_sigaction *) osa;
236 1.8 thorpej } */ *uap = v;
237 1.12 mycroft struct linux_sigaction nlsa, olsa;
238 1.12 mycroft struct sigaction nbsa, obsa;
239 1.1 fvdl int error;
240 1.1 fvdl
241 1.12 mycroft if (SCARG(uap, nsa)) {
242 1.12 mycroft error = copyin(SCARG(uap, nsa), &nlsa, sizeof(nlsa));
243 1.12 mycroft if (error)
244 1.12 mycroft return (error);
245 1.12 mycroft linux_to_native_sigaction(&nlsa, &nbsa);
246 1.12 mycroft }
247 1.12 mycroft error = sigaction1(p, linux_to_native_sig[SCARG(uap, signum)],
248 1.12 mycroft SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0);
249 1.12 mycroft if (error)
250 1.12 mycroft return (error);
251 1.12 mycroft if (SCARG(uap, osa)) {
252 1.12 mycroft native_to_linux_sigaction(&obsa, &olsa);
253 1.12 mycroft error = copyout(&olsa, SCARG(uap, osa), sizeof(olsa));
254 1.12 mycroft if (error)
255 1.12 mycroft return (error);
256 1.1 fvdl }
257 1.12 mycroft return (0);
258 1.1 fvdl }
259 1.1 fvdl
260 1.1 fvdl /*
261 1.1 fvdl * The Linux signal() system call. I think that the signal() in the C
262 1.1 fvdl * library actually calls sigaction, so I doubt this one is ever used.
263 1.1 fvdl * But hey, it can't hurt having it here. The same restrictions as for
264 1.1 fvdl * sigaction() apply.
265 1.1 fvdl */
266 1.1 fvdl int
267 1.9 mycroft linux_sys_signal(p, v, retval)
268 1.1 fvdl register struct proc *p;
269 1.8 thorpej void *v;
270 1.8 thorpej register_t *retval;
271 1.8 thorpej {
272 1.9 mycroft struct linux_sys_signal_args /* {
273 1.1 fvdl syscallarg(int) sig;
274 1.1 fvdl syscallarg(linux_handler_t) handler;
275 1.8 thorpej } */ *uap = v;
276 1.12 mycroft struct sigaction nbsa, obsa;
277 1.1 fvdl int error;
278 1.1 fvdl
279 1.12 mycroft nbsa.sa_handler = SCARG(uap, handler);
280 1.12 mycroft sigemptyset(&nbsa.sa_mask);
281 1.12 mycroft nbsa.sa_flags = SA_RESETHAND | SA_NODEFER;
282 1.12 mycroft error = sigaction1(p, linux_to_native_sig[SCARG(uap, sig)],
283 1.12 mycroft &nbsa, &obsa);
284 1.12 mycroft if (error)
285 1.12 mycroft return (error);
286 1.12 mycroft *retval = (int)obsa.sa_handler;
287 1.12 mycroft return (0);
288 1.1 fvdl }
289 1.1 fvdl
290 1.1 fvdl int
291 1.9 mycroft linux_sys_sigprocmask(p, v, retval)
292 1.1 fvdl register struct proc *p;
293 1.8 thorpej void *v;
294 1.8 thorpej register_t *retval;
295 1.8 thorpej {
296 1.9 mycroft struct linux_sys_sigprocmask_args /* {
297 1.1 fvdl syscallarg(int) how;
298 1.12 mycroft syscallarg(const linux_sigset_t *) set;
299 1.6 mycroft syscallarg(linux_sigset_t *) oset;
300 1.8 thorpej } */ *uap = v;
301 1.12 mycroft linux_sigset_t nlss, olss;
302 1.12 mycroft sigset_t nbss, obss;
303 1.12 mycroft int how;
304 1.12 mycroft int error;
305 1.1 fvdl
306 1.1 fvdl switch (SCARG(uap, how)) {
307 1.1 fvdl case LINUX_SIG_BLOCK:
308 1.12 mycroft how = SIG_BLOCK;
309 1.1 fvdl break;
310 1.1 fvdl case LINUX_SIG_UNBLOCK:
311 1.12 mycroft how = SIG_UNBLOCK;
312 1.1 fvdl break;
313 1.1 fvdl case LINUX_SIG_SETMASK:
314 1.12 mycroft how = SIG_SETMASK;
315 1.1 fvdl break;
316 1.1 fvdl default:
317 1.12 mycroft return (EINVAL);
318 1.1 fvdl }
319 1.1 fvdl
320 1.12 mycroft if (SCARG(uap, set)) {
321 1.12 mycroft error = copyin(SCARG(uap, set), &nlss, sizeof(nlss));
322 1.12 mycroft if (error)
323 1.12 mycroft return (error);
324 1.12 mycroft linux_to_native_sigset(&nlss, &nbss);
325 1.12 mycroft }
326 1.12 mycroft error = sigprocmask1(p, how,
327 1.12 mycroft SCARG(uap, set) ? &nbss : 0, SCARG(uap, oset) ? &obss : 0);
328 1.12 mycroft if (error)
329 1.12 mycroft return (error);
330 1.12 mycroft if (SCARG(uap, oset)) {
331 1.12 mycroft native_to_linux_sigset(&obss, &olss);
332 1.12 mycroft error = copyout(&olss, SCARG(uap, oset), sizeof(olss));
333 1.12 mycroft if (error)
334 1.12 mycroft return (error);
335 1.12 mycroft }
336 1.12 mycroft return (error);
337 1.1 fvdl }
338 1.1 fvdl
339 1.1 fvdl /* ARGSUSED */
340 1.1 fvdl int
341 1.9 mycroft linux_sys_siggetmask(p, v, retval)
342 1.6 mycroft register struct proc *p;
343 1.9 mycroft void *v;
344 1.1 fvdl register_t *retval;
345 1.1 fvdl {
346 1.12 mycroft sigset_t bss;
347 1.12 mycroft linux_sigset_t lss;
348 1.12 mycroft int error;
349 1.6 mycroft
350 1.12 mycroft error = sigprocmask1(p, SIG_SETMASK, 0, &bss);
351 1.12 mycroft if (error)
352 1.12 mycroft return (error);
353 1.12 mycroft native_to_linux_sigset(&bss, &lss);
354 1.12 mycroft *retval = lss;
355 1.12 mycroft return (0);
356 1.1 fvdl }
357 1.1 fvdl
358 1.1 fvdl /*
359 1.1 fvdl * The following three functions fiddle with a process' signal mask.
360 1.1 fvdl * Convert the signal masks because of the different signal
361 1.1 fvdl * values for Linux. The need for this is the reason why
362 1.1 fvdl * they are here, and have not been mapped directly.
363 1.1 fvdl */
364 1.1 fvdl int
365 1.9 mycroft linux_sys_sigsetmask(p, v, retval)
366 1.6 mycroft register struct proc *p;
367 1.8 thorpej void *v;
368 1.8 thorpej register_t *retval;
369 1.8 thorpej {
370 1.9 mycroft struct linux_sys_sigsetmask_args /* {
371 1.1 fvdl syscallarg(linux_sigset_t) mask;
372 1.8 thorpej } */ *uap = v;
373 1.12 mycroft sigset_t nbss, obss;
374 1.12 mycroft linux_sigset_t nlss, olss;
375 1.12 mycroft int error;
376 1.1 fvdl
377 1.12 mycroft nlss = SCARG(uap, mask);
378 1.12 mycroft linux_to_native_sigset(&nlss, &nbss);
379 1.12 mycroft error = sigprocmask1(p, SIG_SETMASK, &nbss, &obss);
380 1.12 mycroft if (error)
381 1.12 mycroft return (error);
382 1.12 mycroft native_to_linux_sigset(&obss, &olss);
383 1.12 mycroft *retval = olss;
384 1.12 mycroft return (0);
385 1.1 fvdl }
386 1.1 fvdl
387 1.1 fvdl int
388 1.9 mycroft linux_sys_sigpending(p, v, retval)
389 1.6 mycroft register struct proc *p;
390 1.8 thorpej void *v;
391 1.8 thorpej register_t *retval;
392 1.8 thorpej {
393 1.9 mycroft struct linux_sys_sigpending_args /* {
394 1.12 mycroft syscallarg(linux_sigset_t *) set;
395 1.8 thorpej } */ *uap = v;
396 1.12 mycroft sigset_t bss;
397 1.12 mycroft linux_sigset_t lss;
398 1.1 fvdl
399 1.12 mycroft sigpending1(p, &bss);
400 1.12 mycroft native_to_linux_sigset(&bss, &lss);
401 1.12 mycroft return copyout(&lss, SCARG(uap, set), sizeof(lss));
402 1.1 fvdl }
403 1.1 fvdl
404 1.1 fvdl int
405 1.9 mycroft linux_sys_sigsuspend(p, v, retval)
406 1.6 mycroft register struct proc *p;
407 1.8 thorpej void *v;
408 1.8 thorpej register_t *retval;
409 1.8 thorpej {
410 1.9 mycroft struct linux_sys_sigsuspend_args /* {
411 1.3 fvdl syscallarg(caddr_t) restart;
412 1.3 fvdl syscallarg(int) oldmask;
413 1.1 fvdl syscallarg(int) mask;
414 1.8 thorpej } */ *uap = v;
415 1.12 mycroft linux_sigset_t lss;
416 1.12 mycroft sigset_t bss;
417 1.12 mycroft
418 1.12 mycroft lss = SCARG(uap, mask);
419 1.12 mycroft linux_to_native_sigset(&lss, &bss);
420 1.12 mycroft return (sigsuspend1(p, &bss));
421 1.3 fvdl }
422 1.3 fvdl
423 1.3 fvdl /*
424 1.3 fvdl * The deprecated pause(2), which is really just an instance
425 1.3 fvdl * of sigsuspend(2).
426 1.3 fvdl */
427 1.3 fvdl int
428 1.9 mycroft linux_sys_pause(p, v, retval)
429 1.6 mycroft register struct proc *p;
430 1.9 mycroft void *v;
431 1.3 fvdl register_t *retval;
432 1.3 fvdl {
433 1.3 fvdl
434 1.12 mycroft return (sigsuspend1(p, 0));
435 1.1 fvdl }
436 1.1 fvdl
437 1.1 fvdl /*
438 1.1 fvdl * Once more: only a signal conversion is needed.
439 1.1 fvdl */
440 1.1 fvdl int
441 1.9 mycroft linux_sys_kill(p, v, retval)
442 1.6 mycroft register struct proc *p;
443 1.8 thorpej void *v;
444 1.8 thorpej register_t *retval;
445 1.8 thorpej {
446 1.9 mycroft struct linux_sys_kill_args /* {
447 1.1 fvdl syscallarg(int) pid;
448 1.1 fvdl syscallarg(int) signum;
449 1.8 thorpej } */ *uap = v;
450 1.9 mycroft struct sys_kill_args ka;
451 1.6 mycroft
452 1.6 mycroft SCARG(&ka, pid) = SCARG(uap, pid);
453 1.12 mycroft SCARG(&ka, signum) = linux_to_native_sig[SCARG(uap, signum)];
454 1.9 mycroft return sys_kill(p, &ka, retval);
455 1.1 fvdl }
456