> In message <199908022217.xaa02...@keep.lan.awfulhak.org> Brian Somers writes: > : Yes, but do it the other way 'round - strtol first, if it's not all > : numeric, getservbyname(). > > I did it getservbyname first in case there were any legacy services > that were all numbers. Traditionally, this is hwo things were done > with IP addresses, although a quickie survey shows it to be a mixed > bag. The biggest reason for not doing getservbyname first is that it > will hang (long timeout) if the databsae behind it goes away.
Exactly - ditto for gethostbyname(). In the case of gethostbyname(), I believe that domain names can't have a number as the first character - I would have thought this idea should follow through with services. I know I'd be pretty annoyed if I tried to do something like ``ssh -p 1234 somewhere'' after configuring my interface in single-user modem with nis in /etc/host.conf and found that ssh was looking up 1234 in /etc/services. Even if this is right, it's not intuitive. > Warner -- Brian <br...@awfulhak.org> <br...@freebsd.org> <http://www.Awfulhak.org> <br...@openbsd.org> Don't _EVER_ lose your sense of humour ! <br...@freebsd.org.uk> To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message