pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: does libfetch need pthreads?

> On Thu, Mar 05, 2009 at 11:23:13AM +0100, Joachim Kuebart wrote:
> > since rev. 1.21 of net/libfetch/files/http.c (05/02/09), building fails
> > on Interix which requires -D_REENTRANT for *_r() calls. Since there is
> > only one single reentrant call in libfetch (gmtime_r() in http.c), I
> > wonder if this may be a mistake and gmtime() would work, too?
> GRMBL. Are they simply hiding the prototype or not including it in libc
> at all? It is using gmtime_r simply to allow use in a threaded program
> with correct locking around libfetch, but it doesn't itself depend on
> pthread in any way.

It would appear they're only hiding the prototype in <time.h> as the
symbols do appear in libc. At any rate, adding -D_REENTRANT was all I
needed to do to make it build successfully.

Having said that, bootstrapping on Interix currently fails anyway
because of an antique <sys/queue.h> which lacks TAILQ_FIRST and
TAILQ_LAST and has broken block macros like TAILQ_INSERT_TAIL
(without "do {...} while(0)") which break when used inside if/else,
for example, in pkg_delete.c. Not sure what can be done about that,
personally I simply replaced <sys/queue.h> with a less broken version.

Best regards,


PS: sorry about the botched the threading, I wasn't subscribed properly

Home | Main Index | Thread Index | Old Index