apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: cvs commit: apr/network_io/unix sockets.c
Date Wed, 08 Aug 2001 02:54:35 GMT
Cliff Woolley <cliffwoolley@yahoo.com> writes:

> On Tue, 7 Aug 2001, Cliff Woolley wrote:
> 
> > > + if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR,
> > &error, &len)) < 0) {
> 
> It seems that len really ought to be an int, not an apr_size_t... I'm
> getting incompatible pointer type warnings on Solaris.

yes, int is better than apr_size_t

actually, I suspect apr_socklen_t is best overall, in case socklen_t
is not int on some system?  (apr_socklen_t is socklen_t if the system
defines it, int otherwise)

(ssh to Tru64)
socklen_t can be unsigned long (64-bit) on Tru64; int wouldn't be cool
there 

(ssh to HP-UX 11)
we're not picking up the modern socklen_t flavor of decls on HP-UX, so
we may possibly pick up another socklen_t warning there (like on
accept()) until that is fixed; not a new problem

(ssh to FreeBSD 3.4)
no problem... apr_socklen_t is int anyway, and getsockopt() takes int * 

I would vote for apr_socklen_t, but I doubt it would compile without
warning everywhere (int won't either).

> I checked the man pages on Solaris, HP-UX, and msdn.microsoft.com, and
> they all specifically say "int" for SO_ERROR.

"int" for SO_ERROR would indicate the type of the 4th parameter to
getsockopt(), not the type of len, which is the same for all
levels/options

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message