getsockname returns the actual length of the address via sin_len. That is why it is called that way (sending it the address of a local variable).
My contribution to WAGing is that getsockname's 3rd parameter was not always socklen_t * . It is/was int * on some (older?) platforms.
Are you porting to an odd platform?
What is the prototype for getsockname on your platform?
Is Autoconf screwing up its detection of getsockname's prototype?
That and line 632 was " if ((tp = gettosbyname("interactive", "tcp")) && "
in my copy of the source but I don't know if you've otherwise edited it.