Functions like accept are known to have THREE different prototypes:
int accept (int, struct sockaddr *, socklen_t *); /* Linux, Unix98 */
int accept (int, struct sockaddr *, size_t *); /* Solaris 2.6 */
int accept (int, struct sockaddr *, int *); /* DEC OSF 4.0e */
I think autoconf should have a
AC_TYPE_SOCKLEN_T
with obvious semantics.
I include this start:
dnl check for socklen_t (in Unix98)
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE([#include <sys/socket.h>
socklen_t x;
],[],[AC_MSG_RESULT(yes)],[
AC_TRY_COMPILE([#include <sys/socket.h>
int accept (int, struct sockaddr *, size_t *);
],[],[
AC_MSG_RESULT(size_t)
AC_DEFINE(socklen_t,size_t)], [
AC_MSG_RESULT(int)
AC_DEFINE(socklen_t,int)])])
ObLegal: I hereby place this message in the public domain.