Will this work? hex edited a file and changed inet_aton to inet_pton
Question: I am trying to port a python script to an old Solaris 10 machine. I downloaded
and installed all the required packages from sunfreeware. It crashed in the
import line (import CGIHTTPServer) with this error message:

> ImportError: ld.so.1: python: fatal: relocation error: file
> /usr/local/lib/python2.6/lib-dynload/_socket.so: symbol inet_aton:
> referenced symbol not found

I tried to recompile with libresolve, but I didn't want to do that, so I
copied the file _socket.so to my linux machine and edited with ghex2. I
replaced the inet_aton with inet_pton because i read that solaris uses
inet_pton instead. I've also read in [python documentation that both system
calls are similar](http://docs.python.org/release/2.5.2/lib/module-
socket.html).

I copied back the file _socket.so to the original dir, backed up the old one
and replaced with the patched one. It's running and looks OK so far.

Do you think the python socket module will break in the future?

Do `inet_aton` and `inet_pton` return structs compatible?


Answer: No; `inet_aton` and `inet_pton` are not compatible. Just look at the
prototypes:

    
    
    int inet_aton(const char *, struct in_addr *);
    int inet_pton(int, const char *, void *);
    

Totally different. Trying to swap one for the other will only result in pain
and suffering (and a crash, most likely). If you've done this and it seems to
be working, it's probably because the code which uses `inet_aton` isn't being
called.

