summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-12-18 02:02:59 +0000
committerdeischen <deischen@FreeBSD.org>2001-12-18 02:02:59 +0000
commit07b826ed269a3fa089c7e6f2c0041501095a0ef9 (patch)
tree1330dcee4073e51059550bcd1622e50c3b336afa /lib
parent6e9f1df98f816467a63dc5b41cea58f28843e390 (diff)
downloadFreeBSD-src-07b826ed269a3fa089c7e6f2c0041501095a0ef9.zip
FreeBSD-src-07b826ed269a3fa089c7e6f2c0041501095a0ef9.tar.gz
Fix the retrieval of USRSTACK via sysctl so that it works for 64-bit
archs. This should fix libc_r on alpha. Submitted by: Bernd Walter <ticso@cicely9.cicely.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc_r/uthread/uthread_init.c4
-rw-r--r--lib/libkse/thread/thr_init.c4
-rw-r--r--lib/libpthread/thread/thr_init.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc_r/uthread/uthread_init.c b/lib/libc_r/uthread/uthread_init.c
index 30ec765..cac38dc 100644
--- a/lib/libc_r/uthread/uthread_init.c
+++ b/lib/libc_r/uthread/uthread_init.c
@@ -269,9 +269,9 @@ _thread_init(void)
/* Find the stack top */
mib[0] = CTL_KERN;
mib[1] = KERN_USRSTACK;
- len = sizeof (int);
+ len = sizeof (_usrstack);
if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1)
- _usrstack = USRSTACK;
+ _usrstack = (void *)USRSTACK;
/*
* Create a red zone below the main stack. All other stacks are
* constrained to a maximum size by the paramters passed to
diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c
index 30ec765..cac38dc 100644
--- a/lib/libkse/thread/thr_init.c
+++ b/lib/libkse/thread/thr_init.c
@@ -269,9 +269,9 @@ _thread_init(void)
/* Find the stack top */
mib[0] = CTL_KERN;
mib[1] = KERN_USRSTACK;
- len = sizeof (int);
+ len = sizeof (_usrstack);
if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1)
- _usrstack = USRSTACK;
+ _usrstack = (void *)USRSTACK;
/*
* Create a red zone below the main stack. All other stacks are
* constrained to a maximum size by the paramters passed to
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index 30ec765..cac38dc 100644
--- a/lib/libpthread/thread/thr_init.c
+++ b/lib/libpthread/thread/thr_init.c
@@ -269,9 +269,9 @@ _thread_init(void)
/* Find the stack top */
mib[0] = CTL_KERN;
mib[1] = KERN_USRSTACK;
- len = sizeof (int);
+ len = sizeof (_usrstack);
if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1)
- _usrstack = USRSTACK;
+ _usrstack = (void *)USRSTACK;
/*
* Create a red zone below the main stack. All other stacks are
* constrained to a maximum size by the paramters passed to
OpenPOWER on IntegriCloud