Problem
I have an application source that compiles and works correctly on SCO OpenServer 5. However, if I compile the application on SCO OpenServer 6.0.0 and run it then gethostbyname(SLIB-osr5) fails with an "Unknown host" error. The host that gethostbyname is trying to resolve is not resolvable with DNS.
Cause
In OpenServer 5, if the name passed to gethostbyname is an ASCII string that is a printable version of a valid ip address, then gethostbyname returns a faked up hostent entry with that ip address if the IP address is not resolvable.
In OpenServer 6.0.0, gethostbyname doesn't do that.
Solution
There are two possible workarounds to this problem:
1) Compile the application on OpenServer 6.0.0 using the OpenServer 5 ABI (-K osr)
For example, if your source is called foobar.c then compile it as follows:
# cc foobar.c -lsocket -K osr -o foobar.osr52) Compile the application on OpenServer 6.0.0 and link against libresolv.so.
Using the foobar.c example above, compile as follows:
# cc foobar.c -lresolv -lsocket -o foobar