diff options
author | marcel <marcel@FreeBSD.org> | 2000-09-06 06:08:54 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2000-09-06 06:08:54 +0000 |
commit | 745048429c466ca87dcce5bf5c39d0dfaed7ef28 (patch) | |
tree | 4c9421d1979cf07065f890a3d31f66a093085776 /sys/i386 | |
parent | 7c31a7e63d338c948e2a86d409d8c0c968bf7ab3 (diff) | |
download | FreeBSD-src-745048429c466ca87dcce5bf5c39d0dfaed7ef28.zip FreeBSD-src-745048429c466ca87dcce5bf5c39d0dfaed7ef28.tar.gz |
When sigaltstack is called with a stack size that's not smaller
than LINUX_MINSIGSTKSZ but smaller than MINSIGSTKSZ, cheat and
pass MINSIGSTKSZ to the kernel. This is a workaround.
Submitted through: nate
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/linux/linux.h | 3 | ||||
-rw-r--r-- | sys/i386/linux/linux_machdep.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h index 3bb4654..8887ec3 100644 --- a/sys/i386/linux/linux.h +++ b/sys/i386/linux/linux.h @@ -157,6 +157,9 @@ struct linux_new_utsname { #define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig) #define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig) +/* sigaltstack */ +#define LINUX_MINSIGSTKSZ 2048 + typedef void (*linux_handler_t)(int); typedef u_long linux_osigset_t; diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 14e8a53..afcfd4c 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -612,7 +612,8 @@ linux_sigaltstack(p, uap) ss = stackgap_alloc(&sg, sizeof(stack_t)); ss->ss_sp = lss.ss_sp; - ss->ss_size = lss.ss_size; + ss->ss_size = (lss.ss_size >= LINUX_MINSIGSTKSZ && + lss.ss_size < MINSIGSTKSZ) ? MINSIGSTKSZ : lss.ss_size; ss->ss_flags = lss.ss_flags; oss = (uap->uoss != NULL) |