This is the mail archive of the libc-help@sourceware.org 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]
Other format: [Raw text]

resolv: How to use rhook


I would like to use the _rev.rhook to instrument the resolver for
the purpose of determining the status of individual name servers.

I defined USE_HOOKS when glibc was built and set _rev.rhook in my
code to the address of a function with the appropriate signature.
However, when I call getaddrinfo(), my rhook function is not called
and upon return from getaddrinfo(), _rev.hook has been set to 0.
This seems to be because getaddrinfo() always indirectly executes
__res_vinit() which sets rhook to 0.

I'm using GNU C Library version 2.14.1.  I didn't notice any
significant difference in the hook code in the source for version
2.17.

How is this hook intended to be used?

Regards,
Gary


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