getsockname problem ??

Peter C. Bahrs pcb at gator.cacs.usl.edu
Fri May 4 07:04:23 AEST 1990


I am porting some socket stuff from the SUN 3's to the Encore.

The code makes a call to : getsockname (socket, (struct sockaddr*) ptr, &len)
where ptr is of type sockaddr_in.  This seems to work fine on the SUN and
on the VAX and the RT.  I am trying to reference the field :
   ptr->sin_port which is a numeric.  I want to:
sprintf (buff, "%d", ptr->sin_port);
Like I said, it works fine on SUN and VAX but puts some wierd stuff in their
for the Encore.  The weird stuff is not the same port ID as was created.
I doing something non portable?

Encore BSD 4.2, SUN & VAX 4.3


/*----------- Thanks in advance... --------------------------------------+
| Peter C. Bahrs                                                         |
| The USL-NASA Project                                                   |
| Center For Advanced Computer Studies      INET: pcb at gator.cacs.usl.edu |
| 2 Rex Street                                                           |
| University of Southwestern Louisiana      ...!uunet!dalsqnt!gator!pcb  | 
| Lafayette, LA 70504                                                    |
+-----------------------------------------------------------------------*/



More information about the Comp.unix.questions mailing list