From 858c17f9b39e5e111f83a39fadf4c15c4d88f9fe Mon Sep 17 00:00:00 2001 From: dchagin Date: Sat, 9 Jan 2016 17:22:51 +0000 Subject: MFC r283471: According to Linux man sigaltstack(3) shall return EINVAL if the ss argument is not a null pointer, and the ss_flags member pointed to by ss contains flags other than SS_DISABLE. However, in fact, Linux also allows SS_ONSTACK flag which is simply ignored. For buggy apps (at least mono) ignore other than SS_DISABLE flags as a Linux do. While here move MI part of sigaltstack code to the appropriate place. --- sys/amd64/linux/linux.h | 3 --- sys/amd64/linux/linux_machdep.c | 23 ----------------------- 2 files changed, 26 deletions(-) (limited to 'sys/amd64/linux') diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index 0845809..b4e7190 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -250,9 +250,6 @@ struct l_newstat { #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 -int linux_to_bsd_sigaltstack(int lsa); -int bsd_to_linux_sigaltstack(int bsa); - typedef void (*l_handler_t)(l_int); typedef struct { diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index d8704fd..8b0da51 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -87,29 +87,6 @@ __FBSDID("$FreeBSD$"); #include #include -int -linux_to_bsd_sigaltstack(int lsa) -{ - int bsa = 0; - - if (lsa & LINUX_SS_DISABLE) - bsa |= SS_DISABLE; - if (lsa & LINUX_SS_ONSTACK) - bsa |= SS_ONSTACK; - return (bsa); -} - -int -bsd_to_linux_sigaltstack(int bsa) -{ - int lsa = 0; - - if (bsa & SS_DISABLE) - lsa |= LINUX_SS_DISABLE; - if (bsa & SS_ONSTACK) - lsa |= LINUX_SS_ONSTACK; - return (lsa); -} int linux_execve(struct thread *td, struct linux_execve_args *args) -- cgit v1.1