Re: Problem compiling w/POSIX threads (fwd)

Nagy Peter (tegla@katalin.csoma.elte.hu)
Thu, 7 Mar 1996 10:26:26 +0100 (MET)


On Wed, 6 Mar 1996, Eric Plante wrote:
> monLinux:~/xrec$ gcc -c xrec_main.c -D_MIT_POSIX_THREADS
> In file included from /usr/include/pthread/mit/cond.h:45,
> from /usr/include/pthread/mit/pthread.h:56,
> from /usr/include/pthread.h:9,
> from xrec_main.c:3:
> /usr/include/pthread/mit/sys/timers.h:46: redefinition of `struct timespec'
>
> What xrec_main does is irrelevent, since this happens on line 3 of the
> source which is "#include <pthread.h>".I've taken a quick look, and in
> the file /usr/include/pthread/mit/fd.h there is a line that goes:
>
> struct timespec;
>
> And in the file /usr/include/pthread/mit/sys/timer.h there is a line that
> goes:
>
> struct timespec {
> time_t ts_sec;
> long ts_nsec;
> };
>
> SO.. Am I doing something stupid?

That's because there is a struct timespec in <linux/time.h>:
struct timespec {
long tv_sec;
long tv_nsec;
} /* question: why tv_* ??? */

I'm not sure when it made to the kernel include files, it wasn't there in
1.2.13, though.

tegla