Subject: socklen_t vs size_t

From: Hideaki YOSHIFUJI <[email-masked]>
Date: Sun, 30 Apr 2000 23:36:13 +0900

Hi, all.

Glibc people has recently changed prototypes of getnameinfo() and
inet_ntop etc. (size_t -> socklen_t) like this:

extern int getnameinfo (__const struct sockaddr *__restrict __sa,
                        socklen_t __salen, char *__restrict __host,
                        socklen_t __hostlen, char *__restrict __serv,
                        socklen_t __servlen, int __flags) __THROW;

extern __const char *inet_ntop (int __af, __const void *__cp,
                                char *__buf, socklen_t __len) __THROW;

Are the definitions in RFC2553 obsolate as they say?  Or, shall 
POSIX and XPG be changed?

Thanks in advance.

-- 
Hideaki YOSHIFUJI <[email-masked]>
Web Page: http://www.ecei.tohoku.ac.jp/%7Eyoshfuji/
PGP5i FP: F731 6599 5EB2 BBA7 1515  1323 1806 A96F 5700 6B25 

Subject: Re: socklen_t vs size_t
From: Ulrich Drepper <[email-masked]>
To: Hideaki YOSHIFUJI <[email-masked]>
Cc: Jakub Jelinek <[email-masked]>
Date: 29 Apr 2000 21:29:46 -0700

Hideaki YOSHIFUJI <[email-masked]> writes:

> They MUST be
>       const char *inet_ntop(int af, const void *src,
>                             char *dst, size_t size);
> and
>       int getnameinfo(const struct sockaddr *sa, socklen_t salen,
>                       char *host, size_t hostlen,
>                       char *serv, size_t servlen,
>                       int flags);
> as RFC2553 says.

This is outdated.  The types used for information involving length in
all network functions is socklen_t and not size_t.  The is from POSIX
and XPG.  Better update the RFCs.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------