On 04/26/2014 02:59 PM, Vipul Mehta wrote: > As everything is working fine with the change, can someone please commit this > change to the repository for get_so_error() in sendto_kdc.c > > #if defined(__hpux) > int sockerrlen; > #else > socklen_t sockerrlen; > #endof
I don't think we'd want to make that change exactly. For one thing, it seems likely that there are HPUX compilation environments for which using socklen_t would work and using int would break. Ideally, we want an autoconf test which determines whether the final argument of getsockopt should be int * or socklen_t * under the compiler and CFLAGS specified by the user. From that test we would define a type in include/port-sockets.h, and use that type when calling getsockopt. I'm not immediately sure how to write the autoconf test, though. My hope is that passing socklen_t * as the final getsockopt argument generates a warning on HPUX (perhaps you can verify this), and we can use that to distinguish. But AC_COMPILE_IFELSE doesn't appear to fail on warnings, so I'm not sure what the best autoconf idiom is to look for warnings. I did find http://lists.gnu.org/archive/html/autoconf/2007-05/msg00079.html which works by triyng to to redefine prototypes for accept and connect to determine whether a system is using socklen_t. But it's pretty complicated and the author wasn't completely confident in its correctness at the time. ________________________________________________ Kerberos mailing list [email protected] https://mailman.mit.edu/mailman/listinfo/kerberos
