summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/librthread/rthread_np.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/librthread/rthread_np.c b/lib/librthread/rthread_np.c
index 728d0fc73b9..03c6fdb6a08 100644
--- a/lib/librthread/rthread_np.c
+++ b/lib/librthread/rthread_np.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_np.c,v 1.7 2012/02/18 21:12:09 guenther Exp $ */
+/* $OpenBSD: rthread_np.c,v 1.8 2013/03/31 22:43:53 kurt Exp $ */
/*
* Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org>
* Copyright (c) 2005 Otto Moerbeek <otto@openbsd.org>
@@ -60,17 +60,14 @@ pthread_main_np(void)
int
pthread_stackseg_np(pthread_t thread, stack_t *sinfo)
{
- char *base;
int ret;
struct rlimit rl;
if (thread->stack) {
- base = thread->stack->base;
-#if !defined(MACHINE_STACK_GROWS_UP)
- base += (ptrdiff_t)thread->stack->len;
-#endif
- sinfo->ss_sp = base;
+ sinfo->ss_sp = thread->stack->sp;
sinfo->ss_size = thread->stack->len;
+ if (thread->stack->guardsize != 1)
+ sinfo->ss_size -= thread->stack->guardsize;
sinfo->ss_flags = 0;
ret = 0;
} else if (thread == &_initial_thread) {