aboutsummaryrefslogtreecommitdiff
path: root/devel/linuxthreads
diff options
context:
space:
mode:
authorTor Egge <tegge@FreeBSD.org>2007-03-21 21:40:24 +0000
committerTor Egge <tegge@FreeBSD.org>2007-03-21 21:40:24 +0000
commit18eb964d171821b4d948462ec445460c75100bcc (patch)
treedefa8f4b3b0b29ba747ad8f9e2bc95f4fe6c8726 /devel/linuxthreads
parent3a0ccf7858d54afcfecc88a85f8fe6d8d096c942 (diff)
downloadports-18eb964d171821b4d948462ec445460c75100bcc.tar.gz
ports-18eb964d171821b4d948462ec445460c75100bcc.zip
Notes
Diffstat (limited to 'devel/linuxthreads')
-rw-r--r--devel/linuxthreads/files/patch-aa20
-rw-r--r--devel/linuxthreads/files/wraputhread.c22
2 files changed, 39 insertions, 3 deletions
diff --git a/devel/linuxthreads/files/patch-aa b/devel/linuxthreads/files/patch-aa
index 31cb50737af6..38e9402ebbf2 100644
--- a/devel/linuxthreads/files/patch-aa
+++ b/devel/linuxthreads/files/patch-aa
@@ -311,6 +311,26 @@ diff -ru ../../work/linuxthreads-2.2.3/attr.c ./attr.c
attr->__inheritsched = PTHREAD_EXPLICIT_SCHED;
attr->__scope = PTHREAD_SCOPE_SYSTEM;
attr->__guardsize = ps;
+@@ -283,6 +286,9 @@
+
+ attr->__inheritsched = descr->p_inheritsched;
+ attr->__scope = PTHREAD_SCOPE_SYSTEM;
++ if (descr == &__pthread_initial_thread)
++ attr->__stacksize = 3 * STACK_SIZE;
++ else
+ attr->__stacksize = (char *)(descr + 1) - (char *)descr->p_guardaddr
+ - descr->p_guardsize;
+ attr->__guardsize = descr->p_guardsize;
+@@ -295,6 +301,9 @@
+ otherwise the range of the stack area cannot be computed. */
+ attr->__stacksize += attr->__guardsize;
+ #endif
++ if (descr == &__pthread_initial_thread)
++ attr->__stackaddr = __pthread_initial_thread_bos + 3 * STACK_SIZE;
++ else
+ #ifndef _STACK_GROWS_UP
+ attr->__stackaddr = (char *)(descr + 1);
+ #else
diff -ru ../../work/linuxthreads-2.2.3/cancel.c ./cancel.c
--- ../../work/linuxthreads-2.2.3/cancel.c Thu Apr 12 23:10:53 2001
+++ ./cancel.c Thu Jun 7 22:59:29 2001
diff --git a/devel/linuxthreads/files/wraputhread.c b/devel/linuxthreads/files/wraputhread.c
index b59c2cae4a82..be6a250e9926 100644
--- a/devel/linuxthreads/files/wraputhread.c
+++ b/devel/linuxthreads/files/wraputhread.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: /tmp/pcvs/ports/devel/linuxthreads/files/wraputhread.c,v 1.4 2005-07-22 22:20:21 tegge Exp $
+ * $FreeBSD: /tmp/pcvs/ports/devel/linuxthreads/files/wraputhread.c,v 1.5 2007-03-21 21:40:24 tegge Exp $
*/
#ifdef LINUXTHREADS_WRAP_API
@@ -69,6 +69,7 @@
#define __pthread_detach linuxthreads_pthread_detach
#define __pthread_equal linuxthreads_pthread_equal
#define __pthread_exit linuxthreads_pthread_exit
+#define __pthread_getattr_np linuxthreads_pthread_getattr_np
#define __pthread_getcpuclockid linuxthreads_pthread_getcpuclockid
#define __pthread_getschedparam linuxthreads_pthread_getschedparam
#define __pthread_join linuxthreads_pthread_join
@@ -118,6 +119,7 @@
#define __pthread_detach pthread_detach
#define __pthread_equal pthread_equal
#define __pthread_exit pthread_exit
+#define __pthread_getattr_np pthread_getattr_np
#define __pthread_getschedparam pthread_getschedparam
#define __pthread_join pthread_join
#define __pthread_key_delete pthread_key_delete
@@ -186,6 +188,7 @@ int __pthread_create(pthread_t *,
int __pthread_detach(pthread_t);
int __pthread_equal(pthread_t, pthread_t);
void __pthread_exit(void *);
+int __pthread_getattr_np(pthread_t, pthread_attr_t *);
int __pthread_getconcurrency(void);
int __pthread_getschedparam(pthread_t, int *, struct sched_param *);
void *__pthread_getspecific(pthread_key_t);
@@ -230,6 +233,10 @@ int __pthread_setspecific(pthread_key_t, const void *);
int __pthread_sigmask(int, const sigset_t *, sigset_t *);
void __pthread_testcancel(void);
+extern int pthread_attr_get_np(pthread_t, pthread_attr_t *)
+ __attribute__ ((weak, alias("_pthread_attr_get_np")));
+
+
static pthread_mutex_t allocmutexlock = PTHREAD_MUTEX_INITIALIZER;
enum uthread_mutextype {
UTHREAD_PTHREAD_MUTEX_ERRORCHECK = 1, /* Default POSIX mutex */
@@ -537,9 +544,10 @@ int
_pthread_attr_getstackaddr(const pthread_attr_t **attr,
void **stackaddr)
{
+ size_t stacksize;
if (attr == NULL || *attr == NULL || stackaddr == NULL)
return EINVAL;
- return __pthread_attr_getstackaddr(*attr, stackaddr);
+ return __pthread_attr_getstack(*attr, stackaddr, &stacksize);
}
int
@@ -552,6 +560,14 @@ _pthread_attr_getstacksize(const pthread_attr_t **attr,
}
int
+_pthread_attr_get_np(pthread_t tid, pthread_attr_t **dst)
+{
+ if (dst == NULL || *dst == NULL)
+ return EINVAL;
+ return __pthread_getattr_np(tid, *dst);
+}
+
+int
_pthread_attr_init(pthread_attr_t **attr)
{
int ret;
@@ -1275,7 +1291,7 @@ _pthread_mutexattr_settype(pthread_mutexattr_t **mattr, int type)
PTHREAD_MUTEX_ERRORCHECK);
case UTHREAD_PTHREAD_MUTEX_RECURSIVE:
return __pthread_mutexattr_settype(*mattr,
- PTHREAD_MUTEX_ERRORCHECK);
+ PTHREAD_MUTEX_RECURSIVE);
case UTHREAD_PTHREAD_MUTEX_NORMAL:
return __pthread_mutexattr_settype(*mattr,
PTHREAD_MUTEX_NORMAL);