bug-gnulib
[Top][All Lists]
Advanced

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

Re: sys/socket.h on mingw32 vs socklen (resend)


From: Bruno Haible
Subject: Re: sys/socket.h on mingw32 vs socklen (resend)
Date: Mon, 9 Jan 2006 20:20:18 +0100
User-agent: KMail/1.5

Simon Josefsson wrote:
> >> +  rmdir sys
> >
> > Remove the directory only when it exists and is empty. (Some systems
> > create files in your directories without being asked for, e.g. .DS_Store
> > on MacOS X.)
>
> How do I test for that in a portable way?

Let rmdir do the test, and ignore a possible error:

        -rmdir sys 2>/dev/null

> Applications that need socklen_t should probably depend on
> the sys/socket.h module.  Perhaps the socklen_t module should depend
> on the sys_socket module?

I don't think so: Applications that use <netdb.h> but not <sys/socket.h>
are also supposed to be able to use socklen_t. See
http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html

> Updated patch below.

Looks mostly good.

> +AC_DEFUN([gl_HEADER_SYS_SOCKET],
> +[
> +  AC_CHECK_HEADERS_ONCE([sys/socket.h])
> +  if test $ac_cv_header_sys_socket_h = yes; then
> +    SYS_SOCKET_H=''
> +  else
> +    AC_CHECK_HEADERS_ONCE([winsock2.h])

Here a test for ws2tcpip.h is missing.

> +    SYS_SOCKET_H='sys/socket.h'
> +  fi
> +  AC_SUBST(SYS_SOCKET_H)
> +])

> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ modules/sys_socket        9 Jan 2006 16:24:40 -0000
> @@ -0,0 +1,36 @@
> +Description:
> +A <sys/socket.h> for systems lacking it.
> +(Currently only useful for mingw32, it will simply include winsock2.h.)

The second line doesn't belong here, IMO, since it describes the
implementation of the module, which can change over time if we encounter
more bad systems.

Otherwise it looks fine, please commit!

Bruno





reply via email to

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