summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/amd64/gen/getcontextx.c16
-rw-r--r--lib/libc/arm/gen/getcontextx.c7
-rw-r--r--lib/libc/gen/Symbol.map1
-rw-r--r--lib/libc/i386/gen/getcontextx.c16
-rw-r--r--lib/libc/ia64/gen/getcontextx.c7
-rw-r--r--lib/libc/mips/gen/getcontextx.c7
-rw-r--r--lib/libc/powerpc/gen/getcontextx.c7
-rw-r--r--lib/libc/powerpc64/gen/getcontextx.c7
-rw-r--r--lib/libc/sparc64/gen/getcontextx.c7
-rw-r--r--lib/libthr/thread/thr_sig.c9
10 files changed, 76 insertions, 8 deletions
diff --git a/lib/libc/amd64/gen/getcontextx.c b/lib/libc/amd64/gen/getcontextx.c
index 7412560..749bfbd 100644
--- a/lib/libc/amd64/gen/getcontextx.c
+++ b/lib/libc/amd64/gen/getcontextx.c
@@ -57,14 +57,12 @@ __getcontextx_size(void)
}
int
-__fillcontextx(char *ctx)
+__fillcontextx2(char *ctx)
{
struct amd64_get_xfpustate xfpu;
ucontext_t *ucp;
ucp = (ucontext_t *)ctx;
- if (getcontext(ucp) == -1)
- return (-1);
if (xstate_sz != 0) {
xfpu.addr = (char *)(ucp + 1);
xfpu.len = xstate_sz;
@@ -80,6 +78,18 @@ __fillcontextx(char *ctx)
return (0);
}
+int
+__fillcontextx(char *ctx)
+{
+ ucontext_t *ucp;
+
+ ucp = (ucontext_t *)ctx;
+ if (getcontext(ucp) == -1)
+ return (-1);
+ __fillcontextx2(ctx);
+ return (0);
+}
+
__weak_reference(__getcontextx, getcontextx);
ucontext_t *
diff --git a/lib/libc/arm/gen/getcontextx.c b/lib/libc/arm/gen/getcontextx.c
index 307978a..54f8513 100644
--- a/lib/libc/arm/gen/getcontextx.c
+++ b/lib/libc/arm/gen/getcontextx.c
@@ -40,6 +40,13 @@ __getcontextx_size(void)
}
int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
__fillcontextx(char *ctx)
{
ucontext_t *ucp;
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index 2438951..9e6b38b 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -529,5 +529,6 @@ FBSDprivate_1.0 {
__elf_aux_vector;
__pthread_map_stacks_exec;
__fillcontextx;
+ __fillcontextx2;
__getcontextx_size;
};
diff --git a/lib/libc/i386/gen/getcontextx.c b/lib/libc/i386/gen/getcontextx.c
index 2d3b562..3c6dd33 100644
--- a/lib/libc/i386/gen/getcontextx.c
+++ b/lib/libc/i386/gen/getcontextx.c
@@ -89,14 +89,12 @@ __getcontextx_size(void)
}
int
-__fillcontextx(char *ctx)
+__fillcontextx2(char *ctx)
{
struct i386_get_xfpustate xfpu;
ucontext_t *ucp;
ucp = (ucontext_t *)ctx;
- if (getcontext(ucp) == -1)
- return (-1);
if (xstate_sz != 0) {
xfpu.addr = (char *)(ucp + 1);
xfpu.len = xstate_sz;
@@ -112,6 +110,18 @@ __fillcontextx(char *ctx)
return (0);
}
+int
+__fillcontextx(char *ctx)
+{
+ ucontext_t *ucp;
+
+ ucp = (ucontext_t *)ctx;
+ if (getcontext(ucp) == -1)
+ return (-1);
+ __fillcontextx2(ctx);
+ return (0);
+}
+
__weak_reference(__getcontextx, getcontextx);
ucontext_t *
diff --git a/lib/libc/ia64/gen/getcontextx.c b/lib/libc/ia64/gen/getcontextx.c
index 307978a..54f8513 100644
--- a/lib/libc/ia64/gen/getcontextx.c
+++ b/lib/libc/ia64/gen/getcontextx.c
@@ -40,6 +40,13 @@ __getcontextx_size(void)
}
int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
__fillcontextx(char *ctx)
{
ucontext_t *ucp;
diff --git a/lib/libc/mips/gen/getcontextx.c b/lib/libc/mips/gen/getcontextx.c
index 307978a..54f8513 100644
--- a/lib/libc/mips/gen/getcontextx.c
+++ b/lib/libc/mips/gen/getcontextx.c
@@ -40,6 +40,13 @@ __getcontextx_size(void)
}
int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
__fillcontextx(char *ctx)
{
ucontext_t *ucp;
diff --git a/lib/libc/powerpc/gen/getcontextx.c b/lib/libc/powerpc/gen/getcontextx.c
index 307978a..54f8513 100644
--- a/lib/libc/powerpc/gen/getcontextx.c
+++ b/lib/libc/powerpc/gen/getcontextx.c
@@ -40,6 +40,13 @@ __getcontextx_size(void)
}
int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
__fillcontextx(char *ctx)
{
ucontext_t *ucp;
diff --git a/lib/libc/powerpc64/gen/getcontextx.c b/lib/libc/powerpc64/gen/getcontextx.c
index 307978a..54f8513 100644
--- a/lib/libc/powerpc64/gen/getcontextx.c
+++ b/lib/libc/powerpc64/gen/getcontextx.c
@@ -40,6 +40,13 @@ __getcontextx_size(void)
}
int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
__fillcontextx(char *ctx)
{
ucontext_t *ucp;
diff --git a/lib/libc/sparc64/gen/getcontextx.c b/lib/libc/sparc64/gen/getcontextx.c
index 307978a..54f8513 100644
--- a/lib/libc/sparc64/gen/getcontextx.c
+++ b/lib/libc/sparc64/gen/getcontextx.c
@@ -40,6 +40,13 @@ __getcontextx_size(void)
}
int
+__fillcontextx2(char *ctx)
+{
+
+ return (0);
+}
+
+int
__fillcontextx(char *ctx)
{
ucontext_t *ucp;
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index 86b3a9b..4dbb252 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -323,8 +323,13 @@ check_deferred_signal(struct pthread *curthread)
return;
#if defined(__amd64__) || defined(__i386__)
- uc = alloca(__getcontextx_size());
- __fillcontextx((char *)uc);
+ int uc_len;
+ uc_len = __getcontextx_size();
+ uc = alloca(uc_len);
+ getcontext(uc);
+ if (curthread->deferred_siginfo.si_signo == 0)
+ return;
+ __fillcontextx2((char *)uc);
#else
ucontext_t ucv;
uc = &ucv;
OpenPOWER on IntegriCloud