Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

libnsl - t_getinfo() behaves differently on 64 bit environment

Status
Not open for further replies.

hebbargautham

Programmer
Dec 12, 2007
1
US
Hi,

I am facing an issue with libnsl's t_getinfo(). My application links to libnsl and calls this function. I am calling:
tfd=t_open("/dev/udp",O_RDWR,NULL);
t_getinfo(tfd,&ti);
where, ti is of struct t_info type.
If I try with a 32 bit build, the call to t_getinfo returns a proper t_info structure. However, when I do a 64 bit build (using +DD64 flag )and run the application, almost all fields of t_info structure seem to be having incorrect values. This behavior is consistant with both PARISC and IA64 platforms. I am using HP's ANSI C compiler.

The t_info structure has the below values when I ran a 32 bit build
tfd = 3
t_info.addr = 16
t_info.options = 65535
t_info.tsdu = 65507
t_info.etsdu = -2
t_info.connect = -2
t_info.discon = -2
t_info.servtype = 3

For a 64 bit build, I get the below output:
tfd = 3
t_info.addr = 68719542271
t_info.options = 281354717626366
t_info.tsdu = -4294967298
t_info.etsdu = 12884901891
t_info.connect = 0
t_info.discon = 1073746904
t_info.servtype = 1073997864

Can someone help me to find out what I am missing here. What could be the reason for this strange behavior of libnsl.
 
Imho this is not strange, but expected behaviour.

If you look up the meaning of these variables, e.g. in /usr/include/streams/sys/xti.h, you will find:
struct t_info {
t_scalar_t addr; /* max size of transport protocol */
/* address */
...
Most of these variables are limits, and if you switch from 32 to 64 bits, an increase of limits should be expected.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top