(lib network) Should inet_aton be called instead of inet_addr ?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Wed Sep 24 00:07:47 EDT 2008

On 2008 Sep 22, at 15:13, Matthias Kilian wrote:
> On Mon, Sep 22, 2008 at 07:45:48PM +0100, Ian Lynagh wrote:
>>> Reading http://linux.die.net/man/3/inet_addr I noticed that
>>> inet_addr is obsolete and inet_aton should be used because inet_addr
>>> indicates error by returning -1 which is a valid address  
>>> (
>>> as well.
>>> Don't know wether it's worth changing or wether inet_aton is  
>>> peresent on
>>> all systems
>> It sounds like we shouldchange, although I too don't know how  
>> portable
>> inet_aton is.
> It isn't POSIX, but it's historically from 4.3BSD, so all the BSDs,
> MacOS X should support it, too. I also just verified that it's
> available on a good old IRIX 5.3 ;-)
> And since Solaris was originally based on BSD, it may have inet_aton,
> too. No idea about other systems.

Solaris 10+ probably does, but our Solaris 9 machines don't.  Linux  
and OSX have inet_aton.

(Solaris 2 is not based on BSD, but on AT&T System V.  For example, it  
didn't get real sockets until 2.6; before that they were emulated on  
top of System V streams.)

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

More information about the Libraries mailing list