diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-07-27 06:10:39 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-07-27 06:10:39 +0000 |
commit | d6269a4563bb5e6929a930402c384c02112f5b66 (patch) | |
tree | be92a3fee254977a718adb00e88c909cce2b5e4f /sys/compat/linux/linux_signal.c | |
parent | 5800a67018214e91d6afb1ba94b170772760c709 (diff) |
Convert array lookups to function calls that are bounds checked
Diffstat (limited to 'sys/compat/linux/linux_signal.c')
-rw-r--r-- | sys/compat/linux/linux_signal.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 6c52c88eb4a..1a0b12f8476 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_signal.c,v 1.9 2001/04/09 06:52:26 tholo Exp $ */ +/* $OpenBSD: linux_signal.c,v 1.10 2001/07/27 06:10:38 csapuntz Exp $ */ /* $NetBSD: linux_signal.c,v 1.10 1996/04/04 23:51:36 christos Exp $ */ /* @@ -351,6 +351,26 @@ bsd_to_linux_sigaction(bsa, lsa) lsa->sa__handler = bsa->sa_handler; } +int +linux_to_bsd_signal(int linuxsig, int *bsdsig) +{ + if (linuxsig < 0 || linuxsig > LINUX__NSIG) + return (EINVAL); + + *bsdsig = linux_to_bsd_sig[linuxsig]; + return (0); +} + +int +bsd_to_linux_signal(int bsdsig, int *linuxsig) +{ + if (bsdsig < 0 || bsdsig > NSIG) + return (EINVAL); + + *linuxsig = bsd_to_linux_sig[bsdsig]; + return (0); +} + /* * The Linux sigaction() system call. Do the usual conversions, * and just call sigaction(). Some flags and values are silently |