[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: socklen_t
From: |
Simon Josefsson |
Subject: |
Re: socklen_t |
Date: |
Thu, 01 Sep 2005 13:28:39 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
Albert Chin <address@hidden> writes:
> We created the following macro for curl. It's been tested on the
> following systems:
Has the copyright been assigned to the FSF?
> dnl Check for socklen_t: historically on BSD it is an int, and in
> dnl POSIX 1g it is a type of its own, but some platforms use different
> dnl types for the argument to getsockopt, getpeername, etc. So we
> dnl have to test to find something that will work.
> AC_DEFUN([TYPE_SOCKLEN_T],
> [
> AC_CHECK_TYPE([socklen_t], ,[
> AC_MSG_CHECKING([for socklen_t equivalent])
> AC_CACHE_VAL([socklen_t_equiv],
> [
> # Systems have either "struct sockaddr *" or
> # "void *" as the second argument to getpeername
> socklen_t_equiv=
> for arg2 in "struct sockaddr" void; do
> for t in int size_t unsigned long "unsigned long"; do
> AC_TRY_COMPILE([
> #include <sys/types.h>
> #include <sys/socket.h>
>
> int getpeername (int, $arg2 *, $t *);
A bit weird approach of checking for a compatible type, perhaps, but
if it works, then I'm all for it. Bruno, what do you think?
Thanks,
Simon
Re: socklen_t, Stepan Kasal, 2005/09/12