W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1995

libwww3.0 really isn't thread-safe...

From: Erik Selberg <speed@cs.washington.edu>
Date: Fri, 23 Jun 1995 16:02:24 PDT
Message-Id: <199506232302.QAA25638@meitner.cs.washington.edu>
To: www-lib@w3.org
found this one today.

HTTCP.c and HTNews.c both use gethostbyname --- a seemingly innocuous
call, which returns a pointer to a static struct hostent.

wait, did someone say STATIC?

yup, that's right --- it ain't reentrant (at least on Alphas using
POSIX threads!). The fix? Easy enough --- use gethostbyname_r (the
re-entrant version) and #define _REENTRANT (or #define _THREAD_SAFE).

I'll post patches if someone likes.

Cheers,
-Erik
Received on Friday, 23 June 1995 19:02:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:25 GMT