Re: gethostbyname

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

 



The resolver is in glibc, so there's no /proc entry or
anything to twiddle as it's not in the kernel.
Try setting the RES_TIMEOUT environment variable which
should be used by res_init which initializes the resolver.

See http://www.unet.univie.ac.at/aix/libs/commtrf2/res_init.htm
and try an altavista search on +resolver +timeout

good luck
-mark

Lee Chin <leechinus@yahoo.com> [01/05/11 16:24]:
> Hi,
> gethostbyname just takes too long once in a while on
> certain sites... is there a way to set a time out for
> gethostbyname?
> 
> I tried this:
> act.sa_flags = SA_NOMASK;
> act.sa_handler = connect_timeout;
> sigaction(SIGALRM, &act, NULL);
> alarm(DNS_TIMEOUT);
> hostentry = gethostbyname(host);
> alarm(0);
> 
> but when the alarm happened, I got a SIGSEGV in
> gethostbyname
> 
> Thanks
> Lee
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> -
> : send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux