Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Dec 1998 11:03:58 +0100 (CET)
From:      Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
To:        Icom Development <devel@icom.com>
Cc:        current@FreeBSD.ORG
Subject:   RE: libc_r pthread build problem
Message-ID:  <XFMail.981204110358.asmodai@wxs.nl>
In-Reply-To: <199812032343.PAA03354@devel.dns-host.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03-Dec-98 Icom Development wrote:
> Hi,
>        My "make" in /usr/src fails with the errors I have appended,
> on uthread_mutex.c.  Have I missed an update or is this a known problem?
> 
> --- BEGIN INCLUDED TEXT ---
> ===> lib/libc_r
> cc -O -pipe -DLIBC_RCS -DSYSLIBC_RCS -I/usr/src/lib/libc_r/../libc/include
> -DPTHREAD_KERNEL -D_THREAD_SAFE -DNOPOLL -I/usr/src/lib/libc_r/uthread
> -D__DBINTERFACE_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc_r/../libc/locale
> -DBROKEN_DES -DYP -c /usr/src/lib/libc_r/uthread/uthread_mutex.c -o
> uthread_mutex.o
> /usr/src/lib/libc_r/uthread/uthread_mutex.c: In function
> `pthread_mutex_init':
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:56: `PTHREAD_MUTEX_DEFAULT'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:56: (Each undeclared identifier
> is reported only once
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:56: for each function it appears
> in.)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:78: `PTHREAD_MUTEX_NORMAL'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:79: `PTHREAD_MUTEX_ERRORCHECK'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:84: `PTHREAD_MUTEX_RECURSIVE'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:90: warning: unreachable code at
> beginning of switch statement
> /usr/src/lib/libc_r/uthread/uthread_mutex.c: In function
> `pthread_mutex_trylock':
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:179: `PTHREAD_MUTEX_NORMAL'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:180: `PTHREAD_MUTEX_DEFAULT'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:181: `PTHREAD_MUTEX_ERRORCHECK'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:193: `PTHREAD_MUTEX_RECURSIVE'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:214: warning: unreachable code at
> beginning of switch statement
> /usr/src/lib/libc_r/uthread/uthread_mutex.c: In function
> `pthread_mutex_lock':
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:248: `PTHREAD_MUTEX_NORMAL'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:257: `PTHREAD_MUTEX_ERRORCHECK'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:264: `PTHREAD_MUTEX_DEFAULT'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:294: `PTHREAD_MUTEX_RECURSIVE'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:329: warning: unreachable code at
> beginning of switch statement
> /usr/src/lib/libc_r/uthread/uthread_mutex.c: In function
> `pthread_mutex_unlock':
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:358: `PTHREAD_MUTEX_NORMAL'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:359: `PTHREAD_MUTEX_DEFAULT'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:360: `PTHREAD_MUTEX_ERRORCHECK'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:377: `PTHREAD_MUTEX_RECURSIVE'
> undeclared (first use this function)
> /usr/src/lib/libc_r/uthread/uthread_mutex.c:401: warning: unreachable code at
> beginning of switch statement
> --- END INCLUDED TEXT ---

I have cvsupped twice or thrice (about 6 hours in between) in between builds to
make sure I didn't miss a commit...

looking at the file uthread_mutex.c reveals two include files which might
contain the PTHREAD declarations: pthread.h and pthread_private.h

pthread.h contains the declarations after examination. Curious thing is that
the datestamp is from November the 29th, just a day or two before the problems
started...

snip of pthread.h

enum pthread_mutextype {
        PTHREAD_MUTEX_DEFAULT           = 1,
        PTHREAD_MUTEX_RECURSIVE         = 2,
        PTHREAD_MUTEX_NORMAL            = 3,
        PTHREAD_MUTEX_ERRORCHECK        = 4,
        MUTEX_TYPE_MAX
};

This enumeration looks good to me...

Now to look at uthread_mutex.c:

#ifdef _THREAD_SAFE
#include <pthread.h>
#include "pthread_private.h"

Most logical conclusion I can make is that _THREAD_SAFE isn't defined
somewhere... Else we would have the declarations of pthread.h at our disposal.

Someone care to enlighten me some more on the matter? Because I have no clue
where to look for the #define of _THREAD_SAFE.

Also some more info upon what it's trying to do here might help my
understanding somewhat better... It's trying to build up some sort of thread
routines, I read through pthread(3) but cannot see what uthread is for then...

---
Jeroen Ruigrok van der Werven/Asmodai
asmodai(at)wxs.nl                   |  Cum angelis et pueris,
Junior Network/Security Specialist  |  fideles inveniamur
*BSD & picoBSD: The Power to Serve... <http://www.freebsd.org>;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.981204110358.asmodai>