summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2004-01-26 20:50:02 +0000
committermarc <marc@openbsd.org>2004-01-26 20:50:02 +0000
commite4f7614aa31620bc469eb18abfbe1751841d509f (patch)
tree4fa8628bf68d3269bdd3c15bb2c02397f4ce5327 /lib/libpthread
parentMake sure, when reporting available memory to the common PowerPC code, to (diff)
downloadwireguard-openbsd-e4f7614aa31620bc469eb18abfbe1751841d509f.tar.xz
wireguard-openbsd-e4f7614aa31620bc469eb18abfbe1751841d509f.zip
Change read_stackseg_np to work with any thread, not just the current
thread. Requested by truk at optonline dot net and OK-ed by tedu @.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/include/pthread_np.h4
-rw-r--r--lib/libpthread/man/pthread_stackseg_np.310
-rw-r--r--lib/libpthread/uthread/uthread_stackseg_np.c5
3 files changed, 9 insertions, 10 deletions
diff --git a/lib/libpthread/include/pthread_np.h b/lib/libpthread/include/pthread_np.h
index 5b0b04c67da..8c695209803 100644
--- a/lib/libpthread/include/pthread_np.h
+++ b/lib/libpthread/include/pthread_np.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pthread_np.h,v 1.6 2004/01/15 22:22:11 marc Exp $ */
+/* $OpenBSD: pthread_np.h,v 1.7 2004/01/26 20:50:02 marc Exp $ */
/*
* Copyright (c) 1996-98 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -51,7 +51,7 @@ int pthread_suspend_np(pthread_t);
int pthread_mutexattr_getkind_np(pthread_mutexattr_t);
int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int);
void pthread_set_name_np(pthread_t, char *);
-int pthread_stackseg_np(struct sigaltstack *sinfo);
+int pthread_stackseg_np(pthread_t, stack_t *);
int pthread_switch_add_np(pthread_switch_routine_t);
int pthread_switch_delete_np(pthread_switch_routine_t);
int pthread_main_np(void);
diff --git a/lib/libpthread/man/pthread_stackseg_np.3 b/lib/libpthread/man/pthread_stackseg_np.3
index 37d92c3e68b..1e4c8b13c88 100644
--- a/lib/libpthread/man/pthread_stackseg_np.3
+++ b/lib/libpthread/man/pthread_stackseg_np.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pthread_stackseg_np.3,v 1.3 2004/01/25 14:48:32 jmc Exp $
+.\" $OpenBSD: pthread_stackseg_np.3,v 1.4 2004/01/26 20:50:02 marc Exp $
.\"
.\" PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org>
.\"
@@ -12,11 +12,11 @@
.Fd #include <sys/signal.h>
.Fd #include <pthread_np.h>
.Ft int
-.Fn pthread_stackseg_np "stack_t *sinfo"
+.Fn pthread_stackseg_np "pthread_t thread" "stack_t *sinfo"
.Sh DESCRIPTION
The
.Fn pthread_stackseg_np
-function returns information about the current thread's stack.
+function returns information about the given thread's stack.
A
.Fa stack_t
is the same as a
@@ -37,8 +37,8 @@ The
function will fail if:
.Bl -tag -width Er
.It Bq Er EAGAIN
-Stack information for the current thread is not currently available.
-There is no guarantee that the current thread's stack information will ever
+Stack information for the given thread is not currently available.
+There is no guarantee that the given thread's stack information will ever
become available.
.El
.Sh SEE ALSO
diff --git a/lib/libpthread/uthread/uthread_stackseg_np.c b/lib/libpthread/uthread/uthread_stackseg_np.c
index 2e168a0d531..9a7eeca5ee8 100644
--- a/lib/libpthread/uthread/uthread_stackseg_np.c
+++ b/lib/libpthread/uthread/uthread_stackseg_np.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_stackseg_np.c,v 1.2 2004/01/16 20:46:20 otto Exp $ */
+/* $OpenBSD: uthread_stackseg_np.c,v 1.3 2004/01/26 20:50:02 marc Exp $ */
/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
@@ -21,9 +21,8 @@
*/
int
-pthread_stackseg_np(stack_t *sinfo)
+pthread_stackseg_np(pthread_t thread, stack_t *sinfo)
{
- struct pthread *thread = pthread_self();
char *base;
size_t pgsz;
int ret;