This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bind 8.2 and thread specific resolver state



I do have one design problem with the integration of the BIND 8.2
code.  Adam suggested to use a thread specific resolver state and
added struct __res_state to _pthread_descr_struct.  The problem is
that struct __res_state contains internally already h_errno as:
	int	res_h_errno;		/* last one set for this context */

and _pthread_descr_struct also:

  int * p_h_errnop;             /* pointer to used h_errno variable */
  int p_h_errno;                /* error returned by last netdb function */
...
  struct __res_state *p_resp;	/* Pointer to resolver state */
  struct __res_state p_res;	/* per-thread resolver state */

What is the right thing to do?  Do we need h_errno for old
programs (binary compatibility)?  Or can we just redefine
__h_errno_location to return the thread specific res_h_errno instead
of h_errno?  I fear this doesn't work since h_errno is part of the
exported interface of glibc:
gromit:~/ELisp/pgnus:[0]$ nm /lib/libc.so.6 |grep h_errno
000c8d10 W __h_errno_location
000f59c4 W _h_errno
000f59c4 D h_errno

If we need to keep h_errno, I guess we should set both res_h_errno and
h_errno at the same time - new program might check res_h_errno.

I'll try to generate a preliminary patch today so that you can see the
problem I have.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]