Subject: Re: inet_ntop() prototype question
To: None <>
From: David Laight <>
List: netbsd-users
Date: 04/07/2003 09:28:35
On Mon, Apr 07, 2003 at 09:40:09AM +0200, Christoph Kaegi wrote:
> I'm not sure, if this is the appropriate forum, but
> why is the last parameter of inet_ntop of type socklen_t?
> Stevens has it as size_t, which would make more sense for
> me, as it should specify the length of the buffer in which
> inet_ntop will put an address in presentation format.
> Also, the manpage doesn't even tell, what this argument
> is for.
> Can anybody enlighten me?


It should be socklen_t - the opengroup docs will give the exact definition.
There is no need for it to be size_t because it will never be 'large'.

size_t got used in far too many places (unfortunately) - places where
'int' would be fine.  XNET (the opengroup body) managed to kill some
of them from the network specs before they caused too much trouble
with binary compatibility.


David Laight: