book
Article ID: KB0088597
calendar_today
Updated On:
Description
Resolution:
Description:
==========
EMS version 6.3 64-bit C sample programs built on HPUX ita 11.31 were not able to connect to the EMS server successfully.
Environment:
==========
EMS 6.3 64-bit C program running on HPUX ita 11.31 platform.
Resolution:
======================
EMS 6.3 has added getsockopt() into the socket creation function. The issue is due to the incompatibility between the default BSD Sockets and X/Open Sockets provided by HP-UX.
Linking objects compiled to X/Open Sockets specification and objects compiled to BSD Sockets specification in the same program using the linkage method in method A would erroneously resolve BSD Sockets calls to X/Open Sockets functions in the Xnet library. As a result, the program may result in application core dumps or unexpected Socket errors when it is run.
See following official statement from HP's website:
http://h30499.www3.hp.com/t5/Networking/HP-UX-X-Open-Socket-and-BSD-Socket-Issue/td-p/5346471?jumpid=reg_r1002_usen
An excerpt:
===========
HP-UX provides two styles of Sockets API:
+ default BSD Sockets
+ X/Open Sockets
These two styles of Sockets API have the same function names but they have differences in semantics and argument types. For example, the optlen field in X/Open getsockopt() is size_t type, while BSD getsockopt() is int type. In 64-bit mode, size_t is 64-bit and int is still 32-bit. Linking objects compiled to X/Open Sockets specification and objects compiled to BSD Sockets specification in the same program using the linkage method in method A would erroneously resolve BSD Sockets calls to X/Open Sockets functions in the Xnet library. As a result, the program may result in application core dumps or unexpected Socket errors when it is run. These symptoms commonly occur when BSD Sockets accept(), getpeername(), getsockname(), getsockopt(), recvfrom(),
sendmsg(), and recvmsg() are called.
Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with X/Open Sockets might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_networking(7)).
=================
All aplications need to conform to the X/Open spec. When building the applicaiton, you need to include "-lxnet" into the link option. We intent to include -lxnet in the link option, but we missed it in the Makefile sample.
Issue/Introduction
EMS version 6.3 64-bit C sample programs built on HPUX ita 11.31 were not able to connect to the EMS server successfully.