summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_signal.c31
-rw-r--r--sys/compat/linux/linux_signal.h6
2 files changed, 26 insertions, 11 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index 1a0b12f8476..9115dc93393 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.10 2001/07/27 06:10:38 csapuntz Exp $ */
+/* $OpenBSD: linux_signal.c,v 1.11 2001/08/09 14:15:22 niklas Exp $ */
/* $NetBSD: linux_signal.c,v 1.10 1996/04/04 23:51:36 christos Exp $ */
/*
@@ -841,16 +841,23 @@ linux_sys_sigaltstack(p, v, retval)
caddr_t sg;
sg = stackgap_init(p->p_emul);
- bsd_nss = stackgap_alloc(&sg, sizeof *bsd_nss);
- error = copyin(SCARG(uap, nss), &linux_ss, sizeof linux_ss);
- if (error)
- return (error);
+ if (SCARG(uap, nss) != NULL) {
+ bsd_nss = stackgap_alloc(&sg, sizeof *bsd_nss);
+
+ error = copyin(SCARG(uap, nss), &linux_ss, sizeof linux_ss);
+ if (error)
+ return (error);
+
+ bsd_nss->ss_sp = linux_ss.ss_sp;
+ bsd_nss->ss_size = linux_ss.ss_size;
+ bsd_nss->ss_flags = (linux_ss.ss_flags & LINUX_SS_DISABLE) ?
+ SS_DISABLE : 0;
+
+ SCARG(&sa, nss) = bsd_nss;
+ } else
+ SCARG(&sa, nss) = NULL;
- bsd_nss->ss_sp = linux_ss.ss_sp;
- bsd_nss->ss_size = linux_ss.ss_size;
- bsd_nss->ss_flags = linux_ss.ss_flags;
- SCARG(&sa, nss) = bsd_nss;
if (SCARG(uap, oss) == NULL) {
SCARG(&sa, oss) = NULL;
return (sys_sigaltstack(p, &sa, retval));
@@ -863,7 +870,11 @@ linux_sys_sigaltstack(p, v, retval)
linux_ss.ss_sp = bsd_oss->ss_sp;
linux_ss.ss_size = bsd_oss->ss_size;
- linux_ss.ss_flags = bsd_oss->ss_flags;
+ linux_ss.ss_flags = 0;
+ if (bsd_oss->ss_flags & SS_ONSTACK)
+ linux_ss.ss_flags |= LINUX_SS_ONSTACK;
+ if (bsd_oss->ss_flags & SS_DISABLE)
+ linux_ss.ss_flags |= LINUX_SS_DISABLE;
return (copyout(&linux_ss, SCARG(uap, oss), sizeof linux_ss));
}
diff --git a/sys/compat/linux/linux_signal.h b/sys/compat/linux/linux_signal.h
index c968de65efc..29648cd53d6 100644
--- a/sys/compat/linux/linux_signal.h
+++ b/sys/compat/linux/linux_signal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_signal.h,v 1.6 2001/07/27 06:10:38 csapuntz Exp $ */
+/* $OpenBSD: linux_signal.h,v 1.7 2001/08/09 14:15:22 niklas Exp $ */
/* $NetBSD: linux_signal.h,v 1.4 1995/08/27 20:51:51 fvdl Exp $ */
/*
@@ -114,6 +114,10 @@ struct linux_sigaltstack {
size_t ss_size;
};
+/* ss_flags */
+#define LINUX_SS_ONSTACK 0x00000001
+#define LINUX_SS_DISABLE 0x00000002
+
extern int bsd_to_linux_sig[];
extern int linux_to_bsd_sig[];