NetBSD-Users archive

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

Re: _res value related query



Hi,

Yes, thank you very much.
I have one doubt regarding '_res' state.
In the functions '__res_get_state_nothread(void)'
in res_init.c the initialization is taken care using res_ninit().

Is it really required for '_res' to be initialized in the library? or
User application
should take care of initializing?

Is there any specification which says _res has to be initialized?

Hope my doubt makes some sense to you.

Thanks in Advance,
Channa

On 11/03/2009, Christos Zoulas <christos%astron.com@localhost> wrote:
> In article 
> <515c64960903100429m6cce52bje2c0d8cf14cbb30b%mail.gmail.com@localhost>,
>
> Channa  <channa.kad%gmail.com@localhost> wrote:
>  >Hi,
>  >
>  >I have a query with respect to '_res' resolver state in NetBSD.
>  >Which is define in resolv.h as
>  >
>  >$ cat include/resolv.h
>  >
>  >:
>  >#define _res (*__res_state())
>  >:
>  >
>  >The have the following test case.
>  >
>  >#include <stdio.h>
>  >#include <resolv.h>
>  >#include <netdb.h>
>  >
>  >int main(int argc,char *argv[])
>  >{
>  >  printf("The _res value is %d\n",_res);
>  >
>  >  return 0 ;
>  >}
>  >
>  >when executed gives the following output:
>  >
>  >$ ./test
>  >The _res value is 5
>  >
>  >It always prints the value '5'.
>  >Could anyone tell me why the value 5??
>
>
> The first value of the struct is retrans which is set to RES_TIMEOUT.
>
>
>  christos
>
>


Home | Main Index | Thread Index | Old Index