bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

socklen_t on HP/UX


From: Dustin J. Mitchell
Subject: socklen_t on HP/UX
Date: Tue, 20 May 2008 14:47:59 -0400

As you probably know, on HP/UX, accept, getpeername, et al. take (..,
int *addrlen), not (.., socklen_t *addrlen) unless _XOPEN_SOURCE and
_XOPEN_SOURCE_EXTENDED are defined.  However, if these macros are not
defined, socklen_t is still defined.

This means that the test in socklen.m4 doesn't have any effect (as it
finds the type already defined).  The result is code that compiles,
but because of the endianness of the 64-bit processor, fails at
runtime.

I think it would make sense to run the compile check even if socklen_t
is defined.  What I don't know is what to do if it turns out that
socklen_t is the wrong type to pass to these functions?  "#undef
socklen_t\n#define socklen_t int"?  Or try to use a type with a
different name, e.g., socklen_t_equiv, throughout the source code?

I'm trying the latter solution within Amanda, since I can replace all
uses of socklen_t without much trouble.  Is there a way to solve this
within gnulib, though?

Dustin

-- 
Storage Software Engineer
http://www.zmanda.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]